Home › Support › Image Store › Adding items in cart to page
-
AuthorPosts
-
March 10, 2015 at 12:57 pm #256388totallytechParticipant
Hey,
I’ve been rrying to get a section on my site showing either: Items in basket: XX or Your basket is empty.
I’ve found this but its showing Your cart is empty no matter how much is in the cart…
Any ideas how to pull this info out?
echo "<header class='clearfix art-header-image-store'>"; $cart = $_SESSION['wfcart']; $count=0; foreach($cart->items as $item){ $count+= $cart->itemqtys[$item]; } if ($count != '0') { echo "<a href='http://clients.iwphoto.co.uk/shopping-basket/' title='View Shopping Basket' alt='View Shopping Basket' />" . "Items in Basket: ". $count ."</a>"; } else { echo "Your shopping basket is empty."; } echo "</header>";
I’m assuming that $cart = $_SESSION[‘wfcart’]; is not correct, but I cannot find out where it is storing the number of items in the cart?
March 11, 2015 at 10:04 pm #256957Xpark MediaKeymasteryou can access the entire cart data using the global $variable $ImStoreCart (object);
To check if there is items in the cart use:
if( !empty( $ImStoreCart->cart->items ){ // do something here }
to display the number of items in the cart:
echo $ImStoreCart->cart->items
March 12, 2015 at 6:29 am #257209totallytechParticipantThank you 🙂
I’ve added this code
if (!empty($ImStoreCart->cart->items)) { $count = $ImStoreCart->cart->items; echo "Items in Basket: ". $count; } else { echo "Your shopping basket is empty."; }
however it always shows the shopping basket is empty even if it isnt.
any ideas?
March 12, 2015 at 7:01 am #257219totallytechParticipantIs there a list of variables that we can call?
For example I have changed the single photo page layout slightly – http://goo.gl/MLgo1j
It shows the Gallery Name -> Photo Name
[Image] [Sidebar]
[products]but I cannot work out how to find out the hyperlink for the gallery name.
Plus, the link for [photos] [slideshow] [prices] [checkout] will all need adding.
Is there a simple ‘$ImStoreCart->cart->checkout’ type code for each section?March 13, 2015 at 12:15 am #257599Xpark MediaKeymasterThe “tools widget” removed the regular navigation and gives you a widget wit all tools that you can use in the sidebar.
You can also create a page that you can use as a checkout page. using the shortcode
[image-store car=true]
for the car all you have to do is include the global object into scope just before your code use:
global $ImStoreCart;
-
AuthorPosts
- You must be logged in to reply to this topic.