Размер видео: 1280 X 720853 X 480640 X 360
Показать панель управления
Автовоспроизведение
Автоповтор
❤❤❤❤
CODE : ========add_action( 'woocommerce_sale_flash', 'sale_badge_percentage', 25 ); function sale_badge_percentage() { global $product; if ( ! $product->is_on_sale() ) return; if ( $product->is_type( 'simple' ) ) { $max_percentage = ( ( $product->get_regular_price() - $product->get_sale_price() ) / $product->get_regular_price() ) * 100; } elseif ( $product->is_type( 'variable' ) ) { $max_percentage = 0; foreach ( $product->get_children() as $child_id ) { $variation = wc_get_product( $child_id ); $price = $variation->get_regular_price(); $sale = $variation->get_sale_price(); if ( $price != 0 && ! empty( $sale ) ) $percentage = ( $price - $sale ) / $price * 100; if ( $percentage > $max_percentage ) { $max_percentage = $percentage; } } } if ( $max_percentage > 0 ) echo "-" . round($max_percentage) . "%"; // If you would like to show -40% off then add text after % sign}
السلام عليكم برجاء الشرح باللغة العربية بحيث يكون الشرح واضح.اللهجة غير مفهومة .طالما الشرح موجه للعرب عامة وليس لأصحاب اللهجة المحلية
مرحبا في الفيديوهات القادمة انشاء الله
❤❤❤❤
CODE :
========
add_action( 'woocommerce_sale_flash', 'sale_badge_percentage', 25 );
function sale_badge_percentage() {
global $product;
if ( ! $product->is_on_sale() ) return;
if ( $product->is_type( 'simple' ) ) {
$max_percentage = ( ( $product->get_regular_price() - $product->get_sale_price() ) / $product->get_regular_price() ) * 100;
} elseif ( $product->is_type( 'variable' ) ) {
$max_percentage = 0;
foreach ( $product->get_children() as $child_id ) {
$variation = wc_get_product( $child_id );
$price = $variation->get_regular_price();
$sale = $variation->get_sale_price();
if ( $price != 0 && ! empty( $sale ) ) $percentage = ( $price - $sale ) / $price * 100;
if ( $percentage > $max_percentage ) {
$max_percentage = $percentage;
}
}
}
if ( $max_percentage > 0 ) echo "-" . round($max_percentage) . "%"; // If you would like to show -40% off then add text after % sign
}
السلام عليكم
برجاء الشرح باللغة العربية بحيث يكون الشرح واضح.اللهجة غير مفهومة .طالما الشرح موجه للعرب عامة وليس لأصحاب اللهجة المحلية
مرحبا
في الفيديوهات القادمة انشاء الله