[英]Move related product to the sidebar on Woocommerce single products
在woocommerce產品頁面,我想把產品底部頁面的相關產品去掉,放在側邊欄上。
我可以刪除它(在底部):
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 );
並將其添加到側邊欄小部件[related_products]
中。 但如果我這樣做,我會刪除所有相關產品。
你有想法嗎,我該怎么做?
我想這可能對你有幫助。
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20);
首先,您將刪除“woocommerce_after_single_product_summary”並像下面那樣覆蓋。
add_action( 'woocommerce_before_single_product_summary', 'your_function', 25); function your_function(){... ...}
注意:如果您更改/修改上述掛鈎,它將影響產品單頁。
通過短代碼調用小部件中的相關產品后
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.