cart

Clear Woocommerce Cart on Page Load Even for logged in users

匆匆过客 提交于 2020-12-05 12:14:07
问题 I want to clear the cart page on page load if this page is not a cart or a checkout page Even for logged in users and admins, any page then it clears. This code was working but its not anymore /** * Clears WC Cart on Page Load * (Only when not on cart/checkout page) */ add_action( 'wp_head', 'bryce_clear_cart' ); function bryce_clear_cart() { if ( wc_get_page_id( 'cart' ) == get_the_ID() || wc_get_page_id( 'checkout' ) == get_the_ID() ) { return; } WC()->cart->empty_cart( true ); } 回答1:

Clear Woocommerce Cart on Page Load Even for logged in users

夙愿已清 提交于 2020-12-05 12:13:36
问题 I want to clear the cart page on page load if this page is not a cart or a checkout page Even for logged in users and admins, any page then it clears. This code was working but its not anymore /** * Clears WC Cart on Page Load * (Only when not on cart/checkout page) */ add_action( 'wp_head', 'bryce_clear_cart' ); function bryce_clear_cart() { if ( wc_get_page_id( 'cart' ) == get_the_ID() || wc_get_page_id( 'checkout' ) == get_the_ID() ) { return; } WC()->cart->empty_cart( true ); } 回答1:

Display weight and the remaining weight message on woocommerce cart and checkout

安稳与你 提交于 2020-11-29 09:12:57
问题 I need to show to my clients a message in Cart and Checkout page on Wordpress. This message should show the weight of the products in cart and tell them the remaining weight to pay the same shipping cost, so they can buy other products spending the same shipping cost. Is there a dedicated plugin? Thanks 回答1: the following code will display a custom notice in cart and checkout pages displaying the cart total weight and the remaining weight. You will have to set the allowed weight limit in the

Display weight and the remaining weight message on woocommerce cart and checkout

血红的双手。 提交于 2020-11-29 09:10:24
问题 I need to show to my clients a message in Cart and Checkout page on Wordpress. This message should show the weight of the products in cart and tell them the remaining weight to pay the same shipping cost, so they can buy other products spending the same shipping cost. Is there a dedicated plugin? Thanks 回答1: the following code will display a custom notice in cart and checkout pages displaying the cart total weight and the remaining weight. You will have to set the allowed weight limit in the

Display weight and the remaining weight message on woocommerce cart and checkout

喜夏-厌秋 提交于 2020-11-29 09:08:51
问题 I need to show to my clients a message in Cart and Checkout page on Wordpress. This message should show the weight of the products in cart and tell them the remaining weight to pay the same shipping cost, so they can buy other products spending the same shipping cost. Is there a dedicated plugin? Thanks 回答1: the following code will display a custom notice in cart and checkout pages displaying the cart total weight and the remaining weight. You will have to set the allowed weight limit in the