2

i am in the process of implementing the product list , but the thing is , do not know why its been shuffling . if somebody have experience on how to get rid of this.

{{block type="catalog/product_list" name="home.catalog.product.list" category_id="2" template="catalog/product/list.phtml"}}

the above code is in my homepage .

6
  • check product collection sort order something like this ? Commented Sep 7, 2016 at 5:12
  • echo $productcollection->getSelect() in your phtml file Commented Sep 7, 2016 at 5:23
  • ok order of collection is based on position in that category. it should not shuffle than Commented Sep 7, 2016 at 5:52
  • but its been shuffling , any idea why its happening ?
    – Man S.
    Commented Sep 7, 2016 at 5:56
  • have you changed anything in phtml file or is just core file ? Commented Sep 7, 2016 at 6:08

3 Answers 3

2

In case you want to control the number of columns in product listing, please use the following code:

{{block type="catalog/product_list" column_count="4" category_id="2" template="catalog/product/list.phtml"}}

Refresh cache and check it.

Thanks.

1
  • just up vote this ques, so that others can get benefit from this
    – Man S.
    Commented Sep 8, 2016 at 4:46
1

to stop shuffling go to admin panel. click on catalog> manage categories > select your category > display settings > Available Product Listing Sort By > select your desired seting either price , name or valuee , now your products would not be sorted.

1

check the product block,for ->order('rand()')

        $collection = Mage::getResourceModel('catalog/product_collection');
        Mage::getModel('catalog/layer')->prepareProductCollection($collection);
        $collection->getSelect()->order('rand()');
        $collection->addStoreFilter();
        $this->setProductCollection($collection);
        return parent::_beforeToHtml();   

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.