1
我在WooCommerce的後端沒有設置購物車鏈接。相反,我將購物車重定向到結帳頁面。這工作正常,但現在我結束了空的網址。當我將產品添加到購物車時,我會看到「成功添加到購物車中的消息,在此處查看購物車」。 '在這裏看到購物車'鏈接到wc_get_page_permalink('cart')
,但這沒有設置。當購物車不空時設置購物車鏈接
只有當物品在購物車中時,是否可以通過函數設置wc_get_page_permalink('cart')
?
我想是這樣的:
function custom_continue_shopping_redirect_url ($product_id) {
$url = "http://www.url.com"; // Add your link here
return $url;
}
add_filter('wc_add_to_cart_message', 'custom_continue_shopping_redirect_url');
但是,這顯然是更換整個添加到購物車信息。
謝謝。