Jump to content

Products with attributes on custom page Prestashop 1.7


Recommended Posts

Hi,

I trying to create product list on custom page.  I change getNewProducts to getNewProductsFromCategory which return properly products. 

Everything is ok, but product attributes not showing on my page. What else should I do? to display like the attached image 

Thanks in advance 

 

My controller : 

class WomanController extends FrontController
{
    /**
     * Initialize controller
     * @see FrontController::init()
     */

    public function init()
    {
        parent::init();
        $products = Product::getNewProductsFromCategory($this->context->language->id,0, 5,false,'date_add', 'DESC',$category_id);
        $this->context->smarty->assign("products", $products);
        
    }
    /**
     * Assign template vars related to page content
     * @see FrontController::initContent()
     */
    public function initContent()
    {
        parent::initContent();
        $category_id = 10; 
        $this->setTemplate('woman_home.tpl'); 
    }

}

 

ask.jpg

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