Jump to content

Display Products On Prestashop Custom Page.


Recommended Posts

Hello, I am newbie to prestashop. I have added custom page by making a new front controller and its corresponding .tpl file. Its working fine. Now i want to display some products related to specific categories (already added through admin). how i can achieve this ?? any clues ..

Link to comment
Share on other sites

  • 2 weeks later...

You could

  - create a Category php object for each of your categories set in your admin page.

  - use the getProducts method on the Category object to get your products

  - assign them to an array

  - assign this array to smarty

       $this->context->smarty->assign(array(
                    'products'             => $your_array
       ));

 

  - this array will now be available in your template.

    {foreach $products as $product}

        <p>{$products['name']}</p>

    {/foreach}

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