0

I want to display featured product of category at top of the product list with all filters, pagination and sorting.

For Example: I have an array of ID's that should show first in collection when category page open.

1

You can give the position of product which you have display top of the product list.

Go Adminpanel >> Catalog >> Categories.

After that edit that category that you want to show featured product on top. And click on "Product in Category"

Add position of that particular product which you want to show in top like below screen shot.

enter image description here

And check that product. And also one more thing if you don't get the product that run commands and check after that.

Thanks.

| improve this answer | |
  • Thanks but i don't want in this way, i have an array of ID's those should show on top when category load. – Waqar Feb 21 '19 at 5:02
  • Then post your code here so we can understand and give answer of that. – Dharmendra Jadav Feb 21 '19 at 5:25
  • Here is my code : $this->_collection->getSelect()->order(new \Zend_Db_Expr('FIELD(e.entity_id, ' . implode(',', $productIds).')')); – Waqar Feb 21 '19 at 8:16
  • It is working but adding the required products at the end of the list – Waqar Feb 21 '19 at 8:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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