Mình đang làm cái hiển thị sản phẩm gợi ý mua chung ý tưởng là thêm những sản phẩm mix được với nhau vào chung 1 tag rồi show nó ra.

1. Hiện thị sản phẩm chung tags
Sau khi tìm hiểu thì mình nhận ra là Related Products nó show các sản phẩm chung category & tag vì thể chỉ cần remove cái categories đi là chỉ còn cái tag thôi.
/**
* Tạo custom product desciptions
*/
add_filter( 'woocommerce_get_related_product_cat_terms', 'remove_related_product_categories', 10, 2 );
function remove_related_product_categories( $terms_ids, $product_id ){
return array();
}
2. Đổi tên cái tiêu đề Related Products
Dùng luôn cái filter này nhé return là gì thì tùy các sếp ở đây mình để là gợi ý mua cùng.
add_filter('woocommerce_product_related_products_heading',function(){
return 'GỢI Ý MUA CÙNG';
});
3. Shortcode Related Products
Nếu các sếp muốn show cái Related Products ở bất cứ vị trí nào thì nhét cái shortcode này vào nhé, các trường thì chắc không cần giải thích nữa đúng không ạ.
[related_products limit="4" columns ="3" orderby="price"]
Loanh quanh mãi cũng xong