
רוצים שהמשתמשים יידעו מתי נגמר המבצע על המוצרים שבהנחה, הוסיפו את הקוד הבא:
טוב להמרות.
PHP
if (!function_exists( 'evolution_custom_price_html' ) ) :
/**
* Angebotszeitraum beim Produkt anzeigen
*/
function evolution_custom_price_html( $price, $product ){
global $post;
$sales_price_to = get_post_meta($post->ID, '_sale_price_dates_to', true);
if(is_single() && $sales_price_to != "")
{
$sales_price_date_to = date("d/m/y", $sales_price_to);
// Umlaute stets maskieren - Siehe www.math.uni-hamburg.de/doc/html/selfhtml-6.1/tcad.htm
return str_replace( '</ins>', ' </ins> <b>המבצע בתוקף עד: '.$sales_price_date_to.'</b>', $price );
}
else
{
return apply_filters( 'woocommerce_get_price', $price );
}
}
add_filter( 'woocommerce_get_price_html', 'evolution_custom_price_html', 100, 2 );
endif;