WordPress.org

Forums

Events Manager
[resolved] WooCommerce Integration - something that only just works (11 posts)

  1. Hi,

    I have been searching for a few weeks now how to integrate wp events manager into WooCommerce, i am not a developer so making my own plugin using hooks and stuff wasn't really an option.

    I thought i would let people know my discovery, its probably not the best solution but it does work.

    What i wanted to do was simply get my customers to pay using WooCommerce because my particular payment gateway is annoying and only comes on WooCommerce (First Data)

    After some digging and messing around i discovered that I could add items to a cart with a URL, for example: example.com/checkout/?add-to-cart=4763&set_quantity=8. - simply visiting this url will add 8 items to your quart of the product id 4763

    What i did to make this all come together was add this URL too the confirmed booking email template with the #_BOOKEDSPACES place holder in place of the quantity numnber.
    So that the correct number of tickets is automatically added to the users cart, i have a place holder in the url string, like so:

    example.com/checkout/?add-to-cart=4763&set_quantity=#_BOOKEDSPACES - so by adding this url string to ur wp events manager email templates, customers are automatically redirected to the checkout (or cart if u choose) with the correct number of tickets ready to be paid for in their cart.

    There are a few problems with doing it this way:

    1. if a user clicks the link again, it will add additional tickets to the cart. (i reduced this problem by installing a plugin called WooCommerce Max Quantity that sets a max number of items in the cart)

    2. by using a url string to add items to the cart, there can be some funny behaviour with WooCommerce, for example when i delete items from the cart that have been added by the link, if i try to add items back to the cart, the original number of items plus the ones i am adding will be in my cart.

    This works well if the customer clicks the link and pays immediately, if they want to change the number of tickets they have reserved and then change the number of tickets in their cart, this may present some issues.

    To mitigate this I have disabled the ability for users to modify their own bookings and placed a notice that they must call in to modify a booking, but users can still get in to trouble in the cart area.

    I hope this helps someone.

    https://wordpress.org/plugins/events-manager/

  2. angelo
    NetWebLogic Support
    Posted 1 year ago #

    thanks for sharing however WooCommerce integration is already been requested in the pro forums.

  3. Yeh I have seen the requests and a few threads about it. I was just posting what I was able to come up with, in case it was able to help someone.

    :)

  4. caimin_nwl
    NetWebLogic Support
    Posted 1 year ago #

    Cool. Thanks for sharing your workaround - it's bound to help someone else.

  5. correction:

    /?add-to-cart=4763&set_quantity=#_BOOKEDSPACES is wrong

    you cant set_quantity this way. the correct url is:

    /?add-to-cart=4763&quantity=#_BOOKEDSPACES

  6. GideonKimani
    Member
    Posted 1 year ago #

    @Julian, how does Woo know how much to bill for each ticket? Or do you create corresponding tickets as product variations in Woo?

  7. @GideonKimani,

    Yes you are correct, create a product generally labeled Ticket(s).

    Updated: I should have noted, you can notice the product ID in the url where it says
    /?add-to-cart=4763 this product ID is generally the ticket product you create, but as i mention below you can use multiple products and have events manage select the right one depending on the event category of the event booked. check out my blog article it explains it in greater detail.

    If you check out the comments on my blog post on this subject me and a person named Bali stumbled across another way of using this method to be able to sell a different ticket type (WC product) for different event categories. its pretty cool, but lacks a certain elegance. but hay it works.

    Events Manager is so powerful i love it, it has so many possibilities.

  8. The really cool thing i like about this method is that it is done entirely within the settings and features that come default in WooCommerce and Events Manager. They may have not specifically intended to work together, but im pretty sure WooCommerce itself adds products to the cart via a URL in emails much the same way we are doing here with Events Manager so the intended use of the features designed into both the plugins working together is ok. if you feel what im sayin..

    updated: essentially all we are doing here is replacing the shop front/product listing and more importantly the email part of WooCommerce with Events Manager - and then replacing Events Manager payment gateway with WooCommerce

  9. GideonKimani
    Member
    Posted 1 year ago #

    Alright.. Let me give it a try and I'll let you know how it goes.

  10. GideonKimani
    Member
    Posted 1 year ago #

    Great!! It works! Now just to find a way to automate the process. I'm building a user-submitted, multi-event site so doing this for every single ticket for every single event might not be practical.

  11. Yes because the Woo product must be created by an admin or shop manager there is no way of creating a product when a user creates an event, at least not that i know of.

    You may be able to get Gravity forms or similar to allow a user to create a new product and a new event in one smooth process. but im not sure then how you would tell events manager what the product ID is for the product that the user just created.

    I wonder if it is possible to have a form that allows a user to create an event and a Woo product at the same time, the event stores the Woo product ID in some extra meta tables stored in the event, and when the user clicks save it adds the product to their cart. and then maybe make a woocommerce extension that will show the related event information along with the product information in the checkout. i dont even know if thats possible and im sure if you could do it you probably would have already, but i dunno i wish i could help more :P

    Good luck if i think of anything i'll let you know.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Events Manager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic