Support » Plugin: WooCommerce » WooCommerce Grouped product API – not get the “sale_price”

  • Resolved carriechan


    Hello Team,

    WooCommerce Grouped product API – getting the wrong “regular_price” not the “sale_price” (if the products are on sale)

    Please take a look the following screenshot (Pink colour highlighted)

    Thank you!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Abiola



    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 can also recommend <a href="" rel="noopener" target="_blank">the WooCommerce Developer Resources Portal</a> for resources on developing for WooCommerce.
    You can also visit the <a href="" rel="noopener" target="_blank">WooCommerce Facebook group</a> or the <code>#developers</code> channel of the <a href="" rel="noopener" target="_blank">WooCommerce Community Slack</a>. We're lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.
    Thread Starter carriechan


    Thank you Oyadeyi 🙂

    Hey @carriechan,

    I did a bit of testing with this. Say we have a grouped product with three products in it. The “price” that’s saved for the grouped product will be the lowest price of the products in the group. It’ll be saved as a custom field with _price as the key.

    If I edit one product and add a sale price, the grouped price will not change. Viewing the grouped product on the front-end of the site will show the correct prices but the custom field won’t be updated. As a result, the REST API won’t show the updated price either.

    You can remove the product with the sale price from the group, then update the product. After that, add the product back again. That will show the correct price in the REST API.

    It turns out there is an open issue about this on GitHub. I added a comment about your findings to it. Feel free to follow along with developments there.

    Thread Starter carriechan


    Hello @3sonsdevelopment,

    This is the BUG and I gave up the Grouped product API to get the “sale_price”, instead, I have used the “price_html” and get the sale_price / regular_price correctly.

    • This reply was modified 2 years ago by carriechan.
    Margaret S. woo-hc


    Hi @carriechan

    Thanks for sharing the workaround.

    It’ll be helpful for the community in the meantime.

    Hope the issue moves towards a resolution soon on GitHub.

    I’ll mark this thread closed here as further updates can be seen on GitHub.

    If you have other questions, please feel free to open a new topic.


Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘WooCommerce Grouped product API – not get the “sale_price”’ is closed to new replies.