• Resolved polakr

    (@polakr)


    I use the address whisperer, then use the API to calculate the route and calculate the shipping cost from the detected kilometers. I would like to include this price in the total price of the reservation. I used a hidden product field. But since I fill in the value using javascript, the total price is not updated and it is not included in it. Is there any way to achieve this? Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Roland Murg

    (@murgroland)

    Hey @polakr,

    The hidden product field does not update the price calculations, since technically this cannot be changed 🙂

    After updating the field value, you need to manually trigger the price calculation again. You can do this by triggering the wpbs_calculate_price event.

    $(document).trigger('wpbs_calculate_price');
    Thread Starter polakr

    (@polakr)

    Hello Roland,

    thank you so much, that’s exactly what I needed! One more detail: the total price now shows the item, but no label is shown for that item. I filled in the label field in the form.

    Plugin Author Roland Murg

    (@murgroland)

    The value format for product field is price|label , so the field value should be something like 79|Transport Cost

    Thread Starter polakr

    (@polakr)

    Great! Thank you very much for the quick reply.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Value of form field by javascript’ is closed to new replies.