Jump to content

$cart global variable


Recommended Posts

Hello everyone,

 

I am a newbie to Prestashop and website programming so the slightest detail will be useful.

 

1- I am trying to use the variable $cart in the main header template to display the total number of items in cart, but it's only working when I am in the shopping cart page.

<span id="itemsCount">{$cart.summary_string}</span>

why is that and how to solve it?

 

2- I designed the website, upto html and css, to have a cart that is available on all pages in which customers can edit anytime anywhere.

 

How to connect it to the $cart in which any update will take effect? Also, should I put the code of this "global cart" in the header in order to have it appear in all pages?

 

Please find attached images that demonstrate what I am trying to accomplish.

 

Any comments are appreciated.

 

Regards,

 

Ahmad

post-1336110-0-30466800-1490911143_thumb.jpg

post-1336110-0-17684000-1490911145_thumb.jpg

post-1336110-0-09749200-1490911154_thumb.png

Edited by Ahmadoooo (see edit history)
Link to comment
Share on other sites

Currently I am in the process of integrating it into a theme. I am using a starter theme with peestashop 1.7

The images are just from the html file not prestashop, just as an illustration of what I am trying to achieve.

Upto now, I have integrated the top navigation menu into /themes/starterTheme/templates/_partials/header.tpl

I used displayTop hook to display main menu which working ok. And displayNav hook to display language and the signin icon.

Edited by Ahmadoooo (see edit history)
Link to comment
Share on other sites

  • 4 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...