Thay đổi vị trí của giá bán và giá khuyến mãi trong WooCommerce của wordpress, thay đổi cho giá khuyến mãi đứng trước giá gốc :

Mã chèn vào funtions.php
add_filter( 'woocommerce_format_sale_price', 'invert_formatted_sale_price', 10, 3 );
function invert_formatted_sale_price( $price, $regular_price, $sale_price ) {
return '<ins>' . ( is_numeric( $sale_price ) ? wc_price( $sale_price ) : $sale_price ) . '</ins> <del>' . ( is_numeric( $regular_price ) ? wc_price( $regular_price ) : $regular_price ) . '</del>';
}
The following hooked function code will display the Sale price before Regular price:
Display the Sale price before Regular price in WooCommerce
Bài viết liên quan :
6 Theme WordPress hỗ trợ SEO tốt nhất
Chia sẻ theme wordpress bán hàng cực đẹp, cực chuyên nghiệp
Share 10TB Bí Kiếp Luyện Hóa Tiếng Anh Link Max Speed
Chia sẻ theme bán hàng SW Sport đẹp cho wordpress trên themeforest
Chia sẻ theme wordpress bán hàng chuẩn seo đẹp
Kho 10TB tài liệu tiếng anh siêu to khổng lồ
