Magento 2 : Sort product list by custom attribute

by MichaelHa   Last Updated October 20, 2019 05:09 AM

Here is my product list enter image description here

Here is a product has custom attribute image_count == 1 enter image description here

My problem is how to check in list.phtml file

if(image_count == 1) {products with image_count == 1 will be at the top of the list} else {other product}

Any helps. Thank in advance.



Related Questions


Updated February 28, 2017 15:09 PM

Updated August 14, 2017 05:09 AM

Updated November 21, 2017 08:09 AM

Updated July 06, 2018 10:09 AM

Updated March 03, 2017 17:09 PM