Cart page is empty when an Item is removed
-
Hi,
I wanted to customize my cart page so when there is no products on cart, it will show my own customized message using a snippet on functions.php as follows.
remove_action( 'woocommerce_cart_is_empty', 'wc_empty_cart_message', 10 ); add_action( 'woocommerce_cart_is_empty', 'custom_empty_cart_message', 10 ); function custom_empty_cart_message() { $html = '<a href="https://xxx.com/wp-content/uploads/2021/01/CART-1.png"><img class="size-medium wp-image-25512 aligncenter" src="https://xxx.com/wp-content/uploads/2021/01/CART-1-300x169.png"/></a>'; $html .= wp_kses_post( apply_filters( 'wc_empty_cart_message', __( '<p style="text-align: center;">Your Shopping Cart Looks Empty</p><p style="text-align: center;">Your shopping cart is waiting</p>', 'woocommerce' ) ) ); echo $html . '</p></div>';
Then it is all good, when you go through the link – xxx.com/cart, it shows the customized empty cart interface.
Once you add an item -> Go into the cart page -> remove the item -> CART PAGE IS EMPTY instead of showing customized empty interface. Please help on this.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Cart page is empty when an Item is removed’ is closed to new replies.