• Resolved Kevin Vess

    (@kevinvess)


    Hello, I have a site where I replaced the “add to cart” button text with the product price. I used the $product->get_price() method to display the price.

    However, after changing the price on the products linked to a Group product, I noticed the Group product continued to show the old price on our “add to cart” button in the catalog. Although, the price is listed correctly when viewing the Group product.

    If I duplicated the Group product, the price would appear correctly in our button; which lead me to believe this is a caching issue.

    I tried clearing the WooCommerce transients and our server caching, but that did not resolve the issue.

    The single products update the price fine, but only the Group product did not.

    Has anyone else run into this issue?

    Is this a bug with getting the price for a Group product?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Kevin Vess

    (@kevinvess)

    My solution to force the $product->get_price() method to show the correct price on a Group product was to edit the linked products in the Group.

    I temporarily removed a linked product and then updated the Group product. Then re-added the linked product and updated the Group product again.

    After changing the linked products, it updated the Group product price in our “add to cart” button text to the correct price.

    Should WooCommerce have a mechanism for auto-updating the Group product price when it’s linked products get updated?

    Thanks!

    Saif

    (@babylon1999)

    Hello @kevinvess,

    Thank you for sharing the solution!

    As you mentioned this seems to be a caching problem. I’m not sure if this will work, but I would try creating an API call and displaying the value returned in the grouped product button.

    Either way, this is a fairly complex development topic. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    I will also recommend you take the matter to Github as most of the developers are active there: https://github.com/woocommerce/woocommerce

    Hope this helps!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Group Product Price Cached?’ is closed to new replies.