toanloau Posted February 17, 2014 Share Posted February 17, 2014 Hi. I'm studying prestashop, i have pproblem with them. I want to get total product with attribute visibility is everywhere or catalog only. then, i want show it in configuration page of mymodule. Please help me! Sorry for my english, and many thanks in advance! Link to comment Share on other sites More sharing options...
NemoPS Posted February 17, 2014 Share Posted February 17, 2014 You mean you need the product list in your module's config page? Have you tried with Category::getProducts()? Link to comment Share on other sites More sharing options...
toanloau Posted February 18, 2014 Author Share Posted February 18, 2014 (edited) You mean you need the product list in your module's config page? Have you tried with Category::getProducts()? Edited February 18, 2014 by toanloau (see edit history) Link to comment Share on other sites More sharing options...
toanloau Posted February 18, 2014 Author Share Posted February 18, 2014 (edited) You mean you need the product list in your module's config page? Have you tried with Category::getProducts()? I try it, but it didn't work. $product = new Category(); $product_total = $product->getProducts(1,0,0,'','',true,true,false,1,false); $this->context->smarty->assign( array( 'id' => $product_total, ) ); return $this->display(__FILE__, 'testing.tpl'); but in .tpl file show 0, please give me some solution. thank in advance. Edited February 18, 2014 by toanloau (see edit history) Link to comment Share on other sites More sharing options...
NemoPS Posted February 18, 2014 Share Posted February 18, 2014 Parameters are totally wrong, have a look at the original scheme: public function getProducts($id_lang, $p, $n, $order_by = null, $order_way = null, $get_total = false, $active = true, $random = false, $random_number_products = 1, $check_access = true, Context $context = null) You are passing a boolean to order way, and a comma to order by. Also, $n should be a positive integer Link to comment Share on other sites More sharing options...
toanloau Posted February 18, 2014 Author Share Posted February 18, 2014 Parameters are totally wrong, have a look at the original scheme: public function getProducts($id_lang, $p, $n, $order_by = null, $order_way = null, $get_total = false, $active = true, $random = false, $random_number_products = 1, $check_access = true, Context $context = null) You are passing a boolean to order way, and a comma to order by. Also, $n should be a positive integer Thank for your reply. it worked! Link to comment Share on other sites More sharing options...
Recommended Posts