How to get the correct price in PHP
-
Hello,
I have this issue. I’m creating a product feed manually for GMC, and I have some variable products with manually adjusted prices. For example, if a variation costs 149 EUR, then it would cost 179 USD. The price adjustment is made inside the product for each variation.
When I try to get the price for the variation using the get_regular_price() function, it returns me the price that is not adjusted—149 USD instead of 179 USD. Interestingly, if I use the function get_price_html(), it returns the correct price—179 USD. However, I cannot use this function because it contains a lot of HTML formatting.
So, is there a way to extract the correct price when there is a price adjustment made on the product variation level?
- You must be logged in to reply to this topic.