Process catalog_product_prepare_save in magento

Source: Internet
Author: User
Recently I am engaged in Secondary Development of magento, and encountered a problem, that is, I want to perform secondary processing on some data in the product data. After reading the code, we found that there was an event before initProduct: catalog_product_prepare_save, so I thought it would be okay to override this method. I found some information online and found that if I bind another event

Recently I am engaged in Secondary Development of magento, and encountered a problem, that is, I want to perform secondary processing on some data in the product data. After reading the code, we found that there was an event before initProduct: catalog_product_prepare_save, so I thought it would be okay to override this method. I found some information online and found that if I bind another event

Recently I am engaged in Secondary Development of magento, and encountered a problem, that is, I want to perform secondary processing on some data in the product data. After reading the code, we found that there was an event before initProduct: catalog_product_prepare_save, so I thought it would be okay to override this method. I found some information on the Internet and found that if I bind an event, multiple events will be executed. As a result, I added the events event to config. xml according to this idea.

Then add Observer. php under the Model to listen for events. In order to test whether the system's own event can work, I made an output in the system's default event and found that there was indeed a change. So it proves that my thinking is correct. Of course, this also draws on some online materials

Add the following to config. xml:

    ??    ??????    ??????????    ??????????????    ??????????????????    ????????????????????singleton??    ????????????????????Xxx_Web_Model_Observer??    ????????????????????prepareProductAuthor??    ??????????????????    ??????????????    ??????????    ??????    ??

Originally, my class was intended to be written as xxxx/observer, but it was okay. I don't know if I was wrong. Or .. At last, it is OK to write the detailed class name. (Or is it because it is not in the system directory, but in the local directory ?)

The Observer will not be written. Refer to core/mage/bundle/model/observer. php (case sensitive, I ignored it)

Original article address: Process catalog_product_prepare_save in magento. Thank you for sharing it with the original author.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.