0

Im using Woocommerce alongside Event Tickets & Event Tickets Plus for my event bookings. Event Tickets allows you to create fieldsets for attendees in order for the user to fill in the users details for each tickets.

Ideally i need one of those fields (a select field) to update the product price accordingly based on the users selection. Is there a way with Woocommerce where i could add the additional price based on the users selection once they add it to cart? Its just the one select field and the values can be hardcoded with their values in order for this to work, but just need a solution.

Iv looked at Woocommerce plugins that let you add additional options, fees etc, but the Events plugin uses a different post type to Woo so that solution wont really work.

Ideally im hoping i can run a function when a item is added to the cart, get the value of the select field, and add the value of their selection to the item price.

WillL
  • 13
  • 1
  • 8
  • What have you even attempted? Have you looked through the Woocommerce documentation? – Difster Aug 08 '17 at 17:01
  • @Difster iv tried using `woocommerce_before_calculate_totals` and then `foreach ( $cart_object->cart_contents as $key => $value ) {` in my function change the price but dont seem to be getting any luck – WillL Aug 08 '17 at 17:14
  • https://stackoverflow.com/questions/43324605/change-cart-item-prices-in-woocommerce-version-3-0 – Difster Aug 08 '17 at 17:16
  • Thanks @Difster . The set_price has overwritten the existing price though which i have tried. I need it to add a value to the existing price. Iv tried get_price and get_regular_price but they arent returning anything – WillL Aug 08 '17 at 17:43

0 Answers0