Hello Are you using variable products or simple products?
Variable products, with a Regular price for each variation put in, and a Sale price for each variation, plus a date range.
I hit Update one more time on these products after deleting a Regular price for one t shirt variation, then typing the price back in (didn’t change anything else). After hitting update and looking at the product, the Sale price is showing up. I also put this in my functions file:
// Use WC 2.0 variable price format, now include sale price strikeout
add_filter( 'woocommerce_variable_sale_price_html', 'wc_wc20_variation_price_format', 10, 2 );
add_filter( 'woocommerce_variable_price_html', 'wc_wc20_variation_price_format', 10, 2 );
function wc_wc20_variation_price_format( $price, $product ) {
// Main Price
$prices = array( $product->get_variation_price( 'min', true ), $product->get_variation_price( 'max', true ) );
$price = $prices[0] !== $prices[1] ? sprintf( __( 'From: %1$s', 'woocommerce' ), wc_price( $prices[0] ) ) : wc_price( $prices[0] );
// Sale Price
$prices = array( $product->get_variation_regular_price( 'min', true ), $product->get_variation_regular_price( 'max', true ) );
sort( $prices );
$saleprice = $prices[0] !== $prices[1] ? sprintf( __( 'From: %1$s', 'woocommerce' ), wc_price( $prices[0] ) ) : wc_price( $prices[0] );
if ( $price !== $saleprice ) {
$price = '<del>' . $saleprice . '</del> <ins>' . $price . '</ins>';
}
return $price;
}
I’m not sure if it’s my theme that was preventing the Sale price from showing – does this error typically happen due to custom themes? I don’t have a Woocommerce folder of update templates in my theme, I mostly use CSS to format the pages and that’s it.
Are you using a custom theme that you built or are you using a premium paid theme? If you can, try using a default theme for a minute to see if the issue is with the theme for starters.
Seems that hitting “Update” one more time on all the affected products updates the Sale pricing info and my theme is displaying them. I added the item to cart and went to checkout, the Sale price was retained. I’m not exactly sure why hitting Update one more time on the products fixed it, but it may have to do with the code I placed in my functions file for Sale Price display.
That may be the case and it also may have been showing cached version. In any event I’m glad you were able to get the sale prices working correctly.