zomex Posted October 16, 2019 Share Posted October 16, 2019 Hello everyone, I currently have a "we have x products" hardcoded section on my homepage. I'm wondering if there is a variable available to display the total products? I have checked the {debug} variables. It would also be great to be able to display total brands and categories. Thanks. Link to comment Share on other sites More sharing options...
zomex Posted October 17, 2019 Author Share Posted October 17, 2019 Does anyone have any ideas/feedback? Thanks Link to comment Share on other sites More sharing options...
NemoPS Posted October 18, 2019 Share Posted October 18, 2019 You mean the total products in your shop? Regardless of the version I think the easiest way is to code a simple module, hook it to the homepage and use a simple query like SELECT COUNT(id_product) from *prefix*product and return a string, even without template. Here is how to make a simple module, the video down the pagehttp://nemops.com/prestashop-modules-course/ Apart from that I doubt there is a variable already available, at least as far as I know. Or, you can use an override of FrontController.php, using the same query, and then adding the text in any template you choose. 1 Link to comment Share on other sites More sharing options...
zomex Posted October 18, 2019 Author Share Posted October 18, 2019 Many thanks for your reply. Yes that is correct, I was wondering if there was a pre-existing variable. Thanks for confirming there isn't. In this case it makes sense for me to hardcode as there's only a slight time saving to having this dynamic. 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