WooCommerce Integration – something that only just works
-
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 4763What 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.
- The topic ‘WooCommerce Integration – something that only just works’ is closed to new replies.