Archived topic
Empty Cart Button is not in the correct position
7 replies · Started by bluebit on September 22, 2017
pic: https://imgur.com/a/T6PSt
site: http://wildlatina.co/cart/
When the cart is empty, see how "return to shop" button is not in the correct position.
How do I fix this? Also I'd like to change the button to link to the home page.
I think it might require changing the php code? Would I need to install this? https://wordpress.org/plugins/code-snippets/
Hi there,
Your line height option in Customize > Typography > Body is set to 0. You'll want to give that a value.
You will need to add a PHP snippet (using that plugin) to change the URL. This is a great article on that: https://nicola.blog/2015/07/20/change-the-return-to-shop-button-url-in-the-cart-page/
Let me know if you have any other questions :)
The line height actually is set to 1.5 https://imgur.com/a/HHA0C
Why does it say 0 for you?
Oh wait i think i know why, in my custom css plugin it has this
.entry-content p {
line-height: 0;
}
How do I change it the line height for that specific page, the cart page? Is it a certain page id? Cause when the cart is full, i like how it looks like, but when cart empty, the line height needs to be changed.
Try this:
.page-id-31 .entry-content p {
line-height: 1.5;
}
It doesnt do anything. What I want to do is move the Return to Shop button down a bit, so that it looks natural. This is what it looks like pic: https://imgur.com/a/T6PSt
Its covering the white text.
Try the code edited. It was at 0 which was the opposite of what you wanted.
Not sure why you want your original CSS in the first place though. Shouldn't be needed.
This is what happens https://imgur.com/a/U9EeH
I think it might be a better idea just to remove or disable the button, as it really isn't needed. That way we don't have to worry about styling it or putting it in the perfect position.
This is the current php snippet im using, how do i change this to disable/remove the Return to shop button when the cart is empty?
function wc_empty_cart_redirect_url() {
return 'https://wildlatina.co/';
}
add_filter( 'woocommerce_return_to_shop_redirect', 'wc_empty_cart_redirect_url' );
What if you just remove the CSS overall and control if using the customizer?
As for the function, it might be a better question for WooCommerce.