Show sale price dates on quick view
-
Hi there! I’m using a snippet that works great to show sale price dates on WooCommerce product page: https://unlimitedwp.com/ecommercehints/woocommerce-show-sale-price-dates-on-product-page/
However i’m unable to add the same information to YITH Quick View, can someone help me?
This is the code i’m using:
/** * Snippet Name: WooCommerce Display Sale Price Dates * Snippet Author: ecommercehints.com */ add_filter( 'woocommerce_get_price_html', 'ecommercehints_display_sale_price_dates', 100, 2 ); function ecommercehints_display_sale_price_dates( $price, $product ) { $sales_price_from = get_post_meta( $product->id, '_sale_price_dates_from', true ); $sales_price_to = get_post_meta( $product->id, '_sale_price_dates_to', true ); if ( is_product() && $product->is_on_sale() && $sales_price_to != "" ) { $sales_price_date_from = date( "l jS F", $sales_price_from ); $sales_price_date_to = date( "l jS F", $sales_price_to ); $price .= "<br><small>Sale from " . $sales_price_date_from . ' to ' . $sales_price_date_to . "</small>"; } return $price; }
The page I need help with: [log in to see the link]
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.