Welcome to Discussion Forum, where you can ask questions and receive answers from other members of the community.

Is it possible to add a product into a page that i created ? - Prestashop 1.6

0 like 0 dislike
Is it possible to add a product into a page that i created ?
 
Do i have to build some controllers etc. ?
 
Kindly help
asked Jun 7, 2017 in Prestashop by harsh (8,710 points)

1 Answer

0 like 0 dislike

Yes, it is possible to show PrestaShop products on a custom page. You first have to create a front controller through a module as follows.

 

You need to create a separate controller for that in your module at the following path:
 
/modules/supercheckout/controllers/front/fcont.php (where supercheckout is your module name)
 
and write the following code in the file:
 
class SupercheckoutFcontModuleFrontController extends ModuleFrontController
{
 
public function initContent()
{
        parent::initContent();
        $this->setTemplate('template_file.tpl');
}
}

 

And then include the product-list.tpl file of the theme in the template file of your module to list products in on your controller page.

 

{include file="$tpl_dir./product-list.tpl" products=$filtered_products id='block_list_id'}

 

Note: The $filtered_products variable contains the products that are to be loaded on the custom controller page.

 

answered Jun 9, 2017 by raghu_velsof (590 points)
edited Jun 13, 2017 by raghu_velsof

Related questions

1 like 0 dislike
3 answers 509 views
509 views asked Feb 23, 2017 in Prestashop by harsh (8,710 points)
0 like 0 dislike
1 answer 67 views
0 like 0 dislike
0 answers 179 views
0 like 0 dislike
1 answer 36 views
36 views asked Mar 6, 2017 in Prestashop by harsh (8,710 points)
0 like 0 dislike
0 answers 332 views
332 views asked Jun 13, 2017 in Prestashop by harsh (8,710 points)
...