shopping cart icon

  • Posts: 217
  • Thank you received: 1
12 years 11 months ago #39534

Hi Nic,

I would like to make a shopping cart icon if there is something in the cart. So if they navigate away tehy know they have things in the cart.

What is the best way to do this? I imagine I write some code in my php file that detects in the user has a cart? Do you have a feature for this already?

Mat

Please Log in or Create an account to join the conversation.

  • Posts: 217
  • Thank you received: 1
12 years 11 months ago #39537

Reading some posts on the forum you suggest using the hikacart module.

So I should put it somewhere and hide it on every page and then read how many products are in it or if it has nothing in there?

I think I want some code that says if cart exists count how many products are in it then I can do something with that.

Please Log in or Create an account to join the conversation.

  • Posts: 83103
  • Thank you received: 13415
  • MODERATOR
12 years 11 months ago #39714

You can do like that:

$cartClass = hikashop_get('class.cart');
$cart = $cartClass->loadFullCart();
if(!empty($cart->products)){
 //there is stuff in the cart
}

The following user(s) said Thank You: Mat

Please Log in or Create an account to join the conversation.

Time to create page: 0.054 seconds
Powered by Kunena Forum