How can products with images be displayed first in category or filter for an entire collection? (list.phtml)

magento.stackexchange https://magento.stackexchange.com/questions/18257

  •  30-10-2019
  •  | 
  •  

سؤال

Magento store owners with thousands of products will no doubt have difficulty getting images and descriptions for every single product. To try and overcome this myself, I found some code that would allow products that contained images to be displayed first.

$this->getLoadedProductCollection()->setOrder('image'/*or small_image*/, 'desc')

The problem is, it only moves product images first per page and not the entire product collection.

Example: Total of 50 products, 30 contain images and descriptions, the remaining 20 do not.

The desired result would be: if the page sorting was done by 10 products per page, the first 3 pages would contain all the products with images and descriptions followed by the remaining 2 pages of products that do not.

How can products with images be displayed first in a category or filter for an entire collection?

لا يوجد حل صحيح

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى magento.stackexchange
scroll top