• Resolved antykamo

    (@antykamo)


    Hello,

    I have Singe Product page and would like to display the Total price with Addons elsewhere on the page, not under the options.

    Is there a way I can create a custom field that would display the Total price with addons dynamically?

    Thank you

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Vivek Acowebs

    (@viveke)

    Hi,

    To display the total price with addons elsewhere on the product page, you can refer the following jQuery code snippet.
    This code dynamically updates the total price based on selected addons. You can customize it.

    jQuery(document).ready(function () {
    if (typeof wp !== "undefined" && wp.hooks) {
    wp.hooks.addAction('wcpa_fields_updated', 'wcpa', function (price, _fieldData) {
    console.log("Total:"+price.total);
    })
    }
    });

    Please note that the dynamic creation of addon fields is not possible; they must be created within the addon forms to be displayed on the product page.

    Please give it a try and let us know if you require any further assistance.

    • This reply was modified 3 months, 3 weeks ago by Vivek Acowebs.
    Thread Starter antykamo

    (@antykamo)

    Thank you for this! In the end, I managed to just do a bit of CSS, because I wanted to display the Total price above the form instead of below it. Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.