Jump to content

How to show product categories in CMS page


Recommended Posts

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

  • 2 weeks later...
$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

  • 3 years later...

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   ..

  • Like 1
Link to comment
Share on other sites

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...