I am importing sales prices from an inventory API and it works well. I'm setting the product price via meta keys, along with scheduled dates, and it is working; I can see them in product view and in the database.
$campaign_start_date = strtotime( $campaign["startDate"] ); $campaign_end_date = strtotime( $campaign["endDate"] ); $percentage_off_price = $campaign["percentageOffEntirePurchase"];
However, then the problem occurred, WooCommerce wouldn't recognize these products as on sale. After a while, I found out there is another key: _transient_wc_products_onsale
$products_on_sale = get_option( "_transient_wc_products_onsale" );
I then updated these accordingly. It's basically an array of product IDs, that are on sale. After I updated this field, WooCommerce started showing the products on sale in the on sale home view of the website.
However, the prices are not shown, nor is the little marker on the product block that indicates that the product is on sale and displays the sale price.
I have been Googling this for an hour now and I have come up with nothing.
I'm thinking there is another key somewhere, that I must update, but I have no idea. I didn't find anything from the database either.