dazfx Posted May 4, 2011 Share Posted May 4, 2011 How to fill an array products if products of category with id=7 correctly?I tried this method: function smarty_function_myprod($params, &$smarty) { global $smarty, $cookie; $category = new Category(7); $products = $category->getProducts(6, NULL, NULL, "name", "asc"); $smarty->assign(array("products1" => $products)); } But after calling of function myprod the array products1 is empty:(What's wrong? Link to comment Share on other sites More sharing options...
dazfx Posted May 7, 2011 Author Share Posted May 7, 2011 How to fill an array products if products of category with id=7 correctly?I tried this method:function smarty_function_myprod($params, &$smarty) { global $smarty, $cookie; $category = new Category(7); $products = $category->getProducts(6, NULL, NULL, "name", "asc"); $smarty->assign(array("products1" => $products)); } But after calling of function myprod the array products1 is empty:(What's wrong? function smarty_function_myprod($params, &$smarty) { global $smarty, $cookie; $category = new Category($params['cat'], intval($params['cookie']->id_lang)); $products = $category->getProducts($params['cookie']->id_lang, 1, 1, 'position', 'ASC', false, true, true, 4); $smarty->assign(array("myproducts" => $products)); } Link to comment Share on other sites More sharing options...
Recommended Posts