Posted: December 6, 2023 at 5:29 am
|
I have the below code added as a plugin to ensure that I am able to add addons to the ticket such as exhibition booths, t-Shirts, trading tables, mugs etc When I enable the plugin, when the question for exhibition booth is answered “Yes” and that for Trading table is answered “Yes”, I am able to see the price for the booth added to the ticket. However the second product, the trading table is not added at all. If I make it the only product, its added. In short only the first product is added. Kindly assist. I have used the code from this page Regards,
|
Hi Boniface, Is that the actual code you are using right now? The majority of the function is missing so I assume you’ve just included the However, the array is closed here:
This means you only have 1 element in the array but I’d also expect that code to throw a syntax error if that was the case, that I’ve tested this with the above snippet and I’m getting the same results so I’ve asked one of our developers for some feedback. Side note, there is a 3rd party add-on available for this which provides a UI to do the above here: https://aparnascodex.com/downloads/price-modifier-for-event-espresso-4/ |
|
Hi mbote, I’m Event Espresso’s lead developer. I’ve updated the code for the bc_ee_add_product_surcharge so that it now correctly adds more than one product. Keep your products array as is, but update the rest of the code from that snippet. Please let us know if that works. |
|
The support post ‘Product Surcharge’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.