- This topic has 3 replies, 3 voices, and was last updated 14 years, 7 months ago by .
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.
Support site for Tips and Tricks HQ premium products
by
Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore Tweaks › Showing Dynamic "View Cart" Button
Tagged: empty cart, price isn't showing up
Consider I don’t want to show the shopping cart on every page and I have it appear only when someone adds to it, but if they for example leave the page and continue browsing or shopping I’d like them to be able to click “View Cart” and go directly back to it without trying to remember what page it was on, now I simply have a view cart link in the sidebar that always shows even if the cart is invisible/empty:
<div style="text-align:right">
<a href="http://www.website.com/main/gallery/#cart">VIEW CART</a>
</div>
Is there a way to show it only when something is in the cart and hide it otherwise?
You will have to use PHP… try something like this
if (digi_cart_not_empty())
{
// code to show the “view cart”
}
How about is there a template tag or function I can write a conditional statement that allows me to display the product list or category list on my cart page, when the cart is empty vs. the blank page or default link to visit the shop?
Thanks so much.
Thanks Amin, I have this code in place and it works like a charm if anyone is interested in displaying the shortcode on their “empty cart” page.
Also I thought it would be a great benefit to have a URI redirect field for when shoppers do empty their cart.
All the best.