Thay đổi vị trí của giá bán và giá khuyến mãi trong WooCommerce của wordpress

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 :
cdc hover show info 1
cdc hover show info 1

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 này hữu ích như thế nào?

Hãy bấm vào ngôi sao để đánh giá!

Đánh giá trung bình 4.5 / 5. Số phiếu bầu : 4

No votes so far! Be the first to rate this post.

Bài viết liên quan :

 

Sidewalk v1.2 – Theme WordPress làm Blog cá nhân cực đẹp

 

Share Theme Best bản quyền trị giá 59$ full code

 

Theme website wordpress Harvest Store bán hàng đẹp

 

Chia sẻ theme wordpress NUVO v5.5.6 – Nhà hàng, Cafe & Bar

 

Hướng dẫn chỉnh sửa CSS menu 3 cấp trên theme Flatsome

 

Chia sẻ theme wordpress bán hàng đẹp chuẩn seo

 

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x