• Hi,
    I have a product with variations. Now I added an option for power supplies. But when activated or deactivated, the price does not change, but cart price is ok.
    What can I do?

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

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter schlocke

    (@schlocke)

    Already applied this: “Update variable product price”
    http://hottons.com/po_modifications
    –>Does not help

    • This reply was modified 2 years, 10 months ago by schlocke.
    Plugin Author Pektsekye

    (@pektsekye)

    Hello,

    >Already applied this: “Update variable product price”

    I see on your website that the JS file of my extension is not updated:
    wp-content/plugins/product-options-for-woocommerce/view/frontend/web/product/main.js

    You should update this file also.
    The updated file is located in the .zip archive of the modification.

    Then add this line:

    
          var bdi = this.priceDiv.find('bdi'); if (bdi.length){this.priceDiv = bdi;}
    

    before the lines:

    
          if (this.priceDiv.length == 0)
            return;
    

    in the same file.
    To make it update the price correctly with the currency sign.

    Then refresh the updated file in your browser.

    Stanislav

    Thread Starter schlocke

    (@schlocke)

    Ok. Thank you for that.
    But now I have the +10 as a default Option. But the price isn’t raised.
    When I open the page, +10 option is selected, but price is default

    Plugin Author Pektsekye

    (@pektsekye)

    Hello,

    Try to replace the line:

    
     this.preselectOptions();
    

    with:

    
       var inst = this;
       setInterval(function() {             
          inst.preselectOptions();
        }, 1000);
    

    in the file:
    wp-content/plugins/pofw-option-default/view/frontend/web/main.js

    Then refresh the updated file in your browser.

    PS: This file is part of another plugin:
    https://wordpress.org/plugins/pofw-option-default/

    Stanislav

    Thread Starter schlocke

    (@schlocke)

    Thanks, but now I cannot deselect the option anymore, it always returns to the default value…

    Thread Starter schlocke

    (@schlocke)

    I developed my own solution:
    wp-content/plugins/product-options-for-woocommerce/view/frontend/web/product/main.js

    Add this:

    var inst = this;
    setInterval(function() {
    inst.updatePrice()
    }, 1000);

    After
    this.isVariableProduct = true;
    }

    Plugin Author Pektsekye

    (@pektsekye)

    Hello,

    Instead of:

    
    var inst = this;
    setInterval(function() {
     inst.updatePrice()
    }, 1000);
    

    you should use:

    
    var inst = this;
    setTimeout(function() {             
     inst.preselectOptions();
    }, 5000);
    

    The setInterval executes the code again and again until the page is open.
    The setTimeout function executes the code just one time after the specified delay.

    Stanislav

    I’m having a similar issue with the price not updating when options are selected. It updates fine on most products but for variable products it doesn’t work even after following the steps listed above.

    https://www.expertsatthecrafttable.com/store/edc-wallet/

    • This reply was modified 2 years, 6 months ago by simonpiercy.
    Plugin Author Pektsekye

    (@pektsekye)

    Hello,

    I have checked your website. It updates the price on the product page and on the shopping cart page for me.
    I can send you a screenshot by email. My email is pektsekye@gmail.com

    Try to refresh your browser cache. Maybe it still loads the old version of the .js file.

    Stanislav

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Variant product price not updated’ is closed to new replies.