Magento 2 : Sort product list by custom attribute

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

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

Sorting by Custom Attribute value/id

Updated November 21, 2017 08:09 AM