Is it better to override the core module or create an observer in Magento?

StackOverflow https://stackoverflow.com/questions/18675496

  •  28-06-2022
  •  | 
  •  

سؤال

I am trying to customize the review module in Magento.

The goals are

1. To put some socal widgets, such as facebook like, twitter, google plus, pinterest, etc. in the review. So the customer can share their review on their social media accounts.

2. Filter out unappropriate words in the review.

3. Auto approve the reviews.

Is it better to override the core review module or create an observer in magento?

هل كانت مفيدة؟

المحلول

It is always better to have an observer (of course, if possible). This way you have a higher chance of everything working on future upgrades. It also lowers the chance of extension conflicts. This is the order you should keep in mind when trying to change something in Magento.

  1. Create Observer on event
  2. Rewrite core class
  3. Copy core class in local code pool
  4. Edit core file - yeah...never do that
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top