• Resolved rachelboey

    (@rachelboey)


    Hi, I want to calculate and display the variation price based on the input quantity on the Single Product page. Currently the variation’s regular price is displayed between the ‘clear selections’ button and the input text box with this code: <div class=”woocommerce-variation-price”>{{{ data.variation.price_html }}}</div>, which can be found in the file ‘variation.php’ under Woocommerce plugin.

    The functions that I need for the Single Product page is actually used in the ‘Cart’ page, where the jQuery function ‘.trigger()’ is used to detect changes in the quantity input box and afterwhich it automatically calculates and displays the item’s subtotal. This jQuery function can be found in the file ‘class-xa-dynamic-pricing-plugin-public.php’. How can I do the same for the Single Product page?

    Thanks in advance.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi,

    Currently, it is not possible to update the price of the products without clicking on the “Add to basket” button since we do have any javascript in the front end we depend on WooCommerce’s ajax calls.

    Please correct me if I understood your query wrong.

    Thread Starter rachelboey

    (@rachelboey)

    I have managed to display the total product price based on the input quantity, however, the price it is getting is the variation’s regular price: $product->get_price(). How can I get the prices from array in the plugin with ‘foreach’? I can’t seem to access the prices stored in the plugin. Thanks

    Hi,

    The plugin calculates the discount dynamically which means it does not store the discounts anywhere.

    Did you mean the discount of the products are not showing?

    Can you share a screenshot of the rules and the product or cart page where the issue is?

    Regards,

    Thread Starter rachelboey

    (@rachelboey)

    This is a screenshot of my variation selections. The numeric ‘1’ is the variation’s regular price. If I do not input a regular price for the variation, it will not appear in the product page. If I increase the quantity, it multiplies by ‘1’, as shown in the second screenshot.

    I have 3 price rules for each variation, which can be seen here.

    How can I multiply the quantity with these price rules? Thanks.

    Hi,

    We need to check the issue on your site so we will need your admin credentials. So please raise a support here -> https://www.xadapter.com/online-support/

    One of our support executives will check this issue and provide you with a fix.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Calculate and display variation price on Single Product page’ is closed to new replies.