Jump to content

Manufacturer landing page


Recommended Posts

I wonder if it is a way to build a custom landing page for a manufacturer showing 6 items of the brand.

 

At first check on the CMS to do that but there is no way to add products on the editor, maybe creating an landingpage.php on the root of the PS installation and calling for a template (.tpl) can work but not sure if this was the right option and if I can manage the products from the backoffice.

 

Hope someone can give me some help, really appreciate it :)

Link to comment
Share on other sites

I create an landingpage.php at root taken like a guide the code of index.php, that is used for the home, the code is something like this:

require(dirname(__FILE__).'/config/config.inc.php');
ControllerFactory::getController('LandingPageController')->run();

 

Then I need to create a custom controller page, following the example of the home copy some of the code of the IndexController.php and create a file called LandingPage.php with this code:

class LandingPageControllerCore extends FrontController
{
public function displayContent()
{ 
 parent::displayContent();
 self::$smarty->display(_PS_THEME_DIR_.'landingpage.tpl');
}
}

 

At this point I create a file called landingpage.tpl on the template folder I use on my Prestashop, editing some on the htaccess I can call with a friendly url for the custom landing page I want, till here everything goes nice, right now I wonder how to call the products of an specific category.

 

I want to show only 6 products, for this I made a new category to get an unique category Id for the call and later show this products on this custom landing page but don't know how to write the code for this, can anybody help me on this?

 

I believe than do it this is very useful and searching on the forum and googleing didn't find to much.

 

(Sorry about my not so nice English, do my best and keep trying better :) )

Link to comment
Share on other sites

  • 3 months later...
×
×
  • Create New...