Jump to content

[Solved] Can't find Products query...


web_br

Recommended Posts

Hi,

I just want to modify the query that returns the products to be displayed in product-list.tpl. In, classes/Product.php, I did find and modify the query for new products (getNewProducts) but... where is the REAL getProducts function? If I change anything in getProducts, no change at all... even if I change the name of the function... no error whatsoever... Am I missing something here?

Thanks

Link to comment
Share on other sites

  • 3 weeks later...

Ho dude it's right :D

By the way, do you know how to shuffle this array in another ? I've tried this but it doesn't work :

self::$smarty->assign(array(
                   'products' => (isset($cat_products) AND $cat_products) ? $cat_products : NULL,
//The new array        'products_rand' => shuffle((isset($cat_products) AND $cat_products) ? $cat_products : NULL),
                   'id_category' => (int)($this->category->id),
                   'id_category_parent' => (int)($this->category->id_parent),
                   'return_category_name' => Tools::safeOutput($this->category->name),
                   'path' => Tools::getPath((int)($this->category->id)),
                   'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'),
                   'categorySize' => Image::getSize('category'),
                   'mediumSize' => Image::getSize('medium'),
                   'thumbSceneSize' => Image::getSize('thumb_scene'),
                   'homeSize' => Image::getSize('home')
               ));

Link to comment
Share on other sites

And I recall it by the same way ?
Like this ?

$cat_products_rand = shuffle($cat_products);

               self::$smarty->assign(array(
                   'products' => (isset($cat_products) AND $cat_products) ? $cat_products : NULL,
                   'products_rand' => (isset($cat_products_rand) AND $cat_products_rand) ? $cat_products_rand : NULL,
                   'id_category' => (int)($this->category->id),
                   'id_category_parent' => (int)($this->category->id_parent),
                   'return_category_name' => Tools::safeOutput($this->category->name),
                   'path' => Tools::getPath((int)($this->category->id)),
                   'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'),
                   'categorySize' => Image::getSize('category'),
                   'mediumSize' => Image::getSize('medium'),
                   'thumbSceneSize' => Image::getSize('thumb_scene'),
                   'homeSize' => Image::getSize('home')
               ));

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