Skip to main content

shopping cart icon

More
14 years 7 months ago #39534 by Mat
shopping cart icon was created by Mat
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.

More
14 years 7 months ago #39537 by Mat
Replied by Mat on topic Re: shopping cart icon
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.

More
14 years 7 months ago #39714 by nicolas
Replied by nicolas on topic Re: shopping cart icon
You can do like that:
Code:
$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.132 seconds
Powered by Kunena Forum