Ahmadoooo Posted March 30, 2017 Share Posted March 30, 2017 (edited) 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 Edited March 30, 2017 by Ahmadoooo (see edit history) Link to comment Share on other sites More sharing options...
NemoPS Posted March 31, 2017 Share Posted March 31, 2017 Hard to tell, how are you using the html page? Is that integrated as template, correctly?Prestashop version? I take it as it's 1.7 Link to comment Share on other sites More sharing options...
Ahmadoooo Posted March 31, 2017 Author Share Posted March 31, 2017 (edited) Currently I am in the process of integrating it into a theme. I am using a starter theme with peestashop 1.7The 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.tplI used displayTop hook to display main menu which working ok. And displayNav hook to display language and the signin icon. Edited March 31, 2017 by Ahmadoooo (see edit history) Link to comment Share on other sites More sharing options...
Ahmadoooo Posted April 3, 2017 Author Share Posted April 3, 2017 Anyone? Link to comment Share on other sites More sharing options...
Ahmadoooo Posted April 8, 2017 Author Share Posted April 8, 2017 Last call? Link to comment Share on other sites More sharing options...
Juaners Posted August 30, 2017 Share Posted August 30, 2017 Hi!Try to use {$cart.products_count}. It will show only the number of total productsIt worls for me en 1.7 : ) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now