I have added column discount on catalog_product_flat_1 table . On frontend there is dropdown for Offers . It has 2 options like

  1. 15% Offer
  2. 25% Offer

On onchange I want to show list of products based on condition i.e discount = 15%

On which function I have to apply this condition?

enter image description here


You could reach your goal by creating new product attribute and make it as a filter on your category pages, to do this, create new attribute type dropdown and set it as:

  • Use In Layered Navigation - Yes
  • Used in Product Listing - Yes
  • Used for Sorting in Product Listing - Yes

Then reindex:

  • product attributes
  • product flat data

Alternatievely filter your product collection on category pages by adding:

| improve this answer | |
  • I created new attribute called Offer. I have used type i.e dropdown. I am not getting dropdown . Pls see attached screenshot – jassi Oct 3 '16 at 5:30
  • on which page to put this condition – jassi Oct 3 '16 at 8:06
  • Apply this condition on category page, where you getting your product collection filtered by category. Make sure to run proper reindexers first. – jimmy Oct 4 '16 at 15:13

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.