add_filter( 'woocommerce_get_price_html', 'ts_custom_price', 10, 2 );
function ts_custom_price() {
global $product;
if ($product->is_on_sale())
{
if( $product->is_type('simple') || $product->is_type('external') || $product->is_type('grouped') ) {
$regular_price = get_post_meta( $product->get_id(), '_regular_price', true );
$sale_price = get_post_meta( $product->get_id(), '_sale_price', true );
if( !empty($sale_price) ) {
echo '<h4 class="cana_pred_slevou"><small><strong>Před slevou:</strong></small> '.$regular_price.'</h4><h3 class="cena_po_sleve"><strong>Po slevě:</strong> '.$sale_price.'</h3>';
}
}
}
}
Comments
0 B
|👍
/👎