• Resolved coolhatwebdesign

    (@coolhatwebdesign)


    This is incredibly urgent for my client, as they intended for a black friday deal to go online today but it didn’t work. They’re using the latest Woocommerce and for some reason NONE of their sale prices on the product variations they have are displaying. Only the regular price shows up when a customer views an item and its variation. They set a specific date (today) for the sale price but it’s not working at all.

    https://www.ads-software.com/plugins/woocommerce/

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

    (@dezinezone)

    Hello Are you using variable products or simple products?

    Thread Starter coolhatwebdesign

    (@coolhatwebdesign)

    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.

    dezinezone

    (@dezinezone)

    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.

    Thread Starter coolhatwebdesign

    (@coolhatwebdesign)

    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.

    dezinezone

    (@dezinezone)

    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.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Sale prices not displaying!’ is closed to new replies.