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 :
Cách tìm tên theme của một website wordpress
Hướng dẫn tạo thêm wiget sidebar trong WordPress - chỉ hiện mục cố đinh
Share Themes Valenti 5.1.2 giống trang chủ Vietdesigner $59
Chia sẻ Theme WordPress BoomBox bản quyền từ Themeforest làm trang tin tức tạp chí
Chia sẻ bộ skin thesis bản quyền
ĐĂNG SẢN PHẨM HÀNG HOẠT LÊN WEBSITE BÁN HÀNG WORDPRESS