- This topic has 3 replies, 3 voices, and was last updated 10 years, 1 month 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 › eStore : Only show cart to logged in users of the site
Greetings!
Here’s my website: [http://highmetricdomains.com/marketplace/]
My setup WP Estore and Wishlist Member with no particular integration… No page is currently protected at the moment.
I really want hide the shopping cart to users that are not logged in.
See screenshot: [http://screencast.com/t/jE0CXqxz]
I’m using this short code for the shopping cart: [wp_eStore_display_compact_cart4]
I came up with this code but it broke the site:
<div class=”custom-cart-wrapper”>
<?php
if ( is_user_logged_in() ) {
echo eStore_shopping_cart();
} else {
return false;
}
?>
</div>
<div style=”clear: both;”></div>
I’m not really a coder though, I’m just trying my luck
I would really appreciate any help from you guys.
Thank you in advance!
-Arvin
I came up with this code but it broke the site:
What exactly do you mean by “broke the site?”
That function call is incorrect (that function doesn’t exist so I am not sure where you got it from).
You probably want to use something like the following so it shows the compact shopping cart to logged in members only:
<div class="custom-cart-wrapper">
<?php
if ( is_user_logged_in() ) {
echo eStore_display_compact_cart4();
} else {
echo "";
}
?>
</div>
Thanks admin! It worked!
Hi wzp! I got a php error when I played with my own code, but nothing serious happened. All I have to do is remove the code that I pasted.
Thank you so much for your help!
Best Regards,
Arvin