I am building an extension to change the product price on the fly using some observers, everything is okay and works fine except the price layer navigation on the left side.

In the category page view i am using this observer catalog_product_collection_load_after. But the Price Layer navigation is not working on the new prices. Anyone have a suggestion.

Note: the price is on customer level

  • Any solution for that ? – Dhairya Shah Jul 30 '19 at 6:05
  • @DhairyaShah, nothing till now, i think it is impossible as the data are coming directly from some tables – WISAM HAKIM Jul 30 '19 at 20:01

Event catalog_product_collection_load_after is no longer appropriate for this case. In magento 1.9.x there is event catalog_product_collection_load_before.

When using event catalog_product_collection_load_after, you are changing prices after the collection has been instantiated and made available to the Layer class.

However, in Magento 2 the event catalog_product_collection_load_before was not implemented as can be verified in the link https://github.com/magento/magento2/issues/7737.

I believe the solution is rewrite the native Magento collection resource and implement the dispatch for event catalog_product_collection_load_before.

  • I tried this before but unfortunately it did not work, it looks the price is coming from another place and not coming from the collection it self – WISAM HAKIM Apr 28 '18 at 19:40

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.