still searching for empty cart php
-
Hi,
Nobody seems can answer this question as I cannot find anything out there in internet land on this, not even stackoverflow. I had a simple PHP 2 liner that I got from someone on stackoverflow that worked, however my site crashed and I had to reload the theme and lost it.I’m looking for a simple PHP code for my function.php file to change the empty cart page. My previous one that I lost had a whole image over the page which had a picture of a cart and custom message. It was great, I now have the classic woo page with the your cart is empty message. The divi link that people send me doesn’t work as I tried that.
Also I get this response which I don’t understand about folders.Just create a folder called “woocommerce” inside your child theme/ theme
Inside “woocommerce” folder create folder called “cart” and copy the file cart-empty.php from woocommerce (plugin) > templates > cart and paste inside your child theme/theme > woocommerce > cart
Then design the template as you want.
Note: if you are good at code then you can try the above steps.I have no empty-cart php in my theme editor.
this does nothing
function cart_empty_redirect_to_shop() { global $woocommerce, $woocommerce_errors; if ( is_cart() && sizeof($woocommerce->cart->cart_contents) == 0) { wp_safe_redirect( get_permalink( wc_get_page_id( 'shop' ) ) ); exit; } } add_action( 'template_redirect', 'cart_empty_redirect_to_shop' );it leaves the word CART on my page.
thanks for reading..
Leroy
The topic ‘still searching for empty cart php’ is closed to new replies.

