prestatent Posted December 5, 2013 Share Posted December 5, 2013 Prestashop 1.5.4.1 Hi I would like to display certain products & categories on CMS pages. Does anyone know how to do this? Thank you for any help. Link to comment Share on other sites More sharing options...
vekia Posted December 5, 2013 Share Posted December 5, 2013 modification of CmsController. in initcontent() function - create variable with products you want to display, then attach it to the smarty array. after that you will be able to use foreach loop on this variable in cms.tpl file located in your theme directory (foreach loop similar to loop in product-list.tpl) Link to comment Share on other sites More sharing options...
prestatent Posted December 5, 2013 Author Share Posted December 5, 2013 Excellent. Thanks Vekia. As usual you seem to one of the few people on here that actually helps out. I appreciate your time answering my question. Cheers 1 Link to comment Share on other sites More sharing options...
quendi Posted December 19, 2013 Share Posted December 19, 2013 I have the same problem and do not know how to do it. Could you give a solution? Or write in which place and what I have to add? Link to comment Share on other sites More sharing options...
vekia Posted December 19, 2013 Share Posted December 19, 2013 $this->context->smarty->assign(array('MyProducts' => $array_with_products)); $array_with_products - this is a variable contains an array with products you want to display. use this code in initcontent() function in cmsController. then in cms.tpl file use foreach loop to display these products (the same loop as you've got in product-list.tpl) just copy and paste it. Link to comment Share on other sites More sharing options...
vipinchauhan Posted January 11, 2017 Share Posted January 11, 2017 modification of CmsController. in initcontent() function - create variable with products you want to display, then attach it to the smarty array. after that you will be able to use foreach loop on this variable in cms.tpl file located in your theme directory (foreach loop similar to loop in product-list.tpl) I am not developer cant you tell me simple way regard this . want if some click on my cms category or page it will redirect to my category pg and reflect my product .. 1 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