รายการกิจกรรม Magento 2 และวิธีใช้งาน
เผยแพร่แล้ว: 2021-05-07สารบัญ
ในโพสต์นี้เราจะแสดงวิธีใช้ เหตุการณ์ ใน Magento 2 แต่ก่อนอื่น เราต้องเข้าใจเกี่ยวกับ เหตุการณ์ และ ผู้สังเกตการณ์ ก่อน การใช้งานเหตุการณ์และผู้สังเกตการณ์ใน Magento 2 ขึ้นอยู่กับรูปแบบการเผยแพร่-สมัครสมาชิก เมื่อใช้เหตุการณ์และผู้สังเกตการณ์ คุณสามารถเรียกใช้โค้ดที่กำหนดเองเพื่อตอบสนองต่อ เหตุการณ์ Magento ที่เฉพาะเจาะจงหรือแม้แต่เหตุการณ์ที่กำหนดเองได้
เหตุการณ์ใน Magento คืออะไร?
เหตุการณ์ จะถูกส่งโดยโมดูลเมื่อมีการทริกเกอร์การดำเนินการบางอย่าง นอกจากกิจกรรมของตัวเองแล้ว Magento ยังให้คุณสร้างกิจกรรมของคุณเองที่สามารถส่งในโค้ดของคุณได้ เมื่อมีการส่งเหตุการณ์ จะสามารถส่งข้อมูลไปยังผู้สังเกตการณ์ที่กำหนดค่าไว้เพื่อดูเหตุการณ์นั้นได้
ผู้สังเกตการณ์ใน Magento คืออะไร?
ผู้ สังเกตการณ์ เป็นคลาส Magento บางประเภทที่สามารถมีอิทธิพลต่อพฤติกรรมทั่วไป ประสิทธิภาพ หรือเปลี่ยนตรรกะทางธุรกิจ ผู้สังเกตการณ์จะถูกดำเนินการเมื่อเหตุการณ์ที่ได้รับการกำหนดค่าให้รับชมถูกส่งโดยตัวจัดการเหตุการณ์
เมื่อเข้าใจคำศัพท์แล้ว มาเริ่มใช้งานกันเลย!
1. สร้างไฟล์ event.xml
คุณสามารถสร้างไฟล์ event.xml สำหรับพื้นที่ต่างๆ ได้:
- พื้นที่ส่วนกลาง: app/code/Simi/HelloWorld/etc/events.xml
- พื้นที่ส่วนหน้า: app/code/Simi/HelloWorld/etc/frontend/events.xml
- พื้นที่ผู้ดูแลระบบ: app/code/Simi/HelloWorld/etc/adminhtml/events.xml
<?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="my_module_event_before"> <observer name="myObserverName" instance="MyCompany\MyModule\Observer\MyObserver" /> </event> <event name="my_module_event_after"> <observer name="myObserverName" instance="MyCompany\MyModule\Observer\AnotherObserver" /> </event> </config>
2. สร้างคลาสผู้สังเกตการณ์
ในการสร้างผู้สังเกตการณ์ คุณต้องวางไฟล์คลาสของคุณไว้ใต้ไดเร็กทอรี <module-root>/Observer คลาสผู้สังเกตการณ์ของคุณควรใช้ Magento\Framework\Event\ObserverInterface และกำหนดฟังก์ชัน การดำเนิน การ
ด้านล่างนี้เป็นตัวอย่างของโครงสร้างคลาสผู้สังเกตการณ์พื้นฐาน:
เนมสเปซ MyCompany\MyModule\Observer; ใช้ Magento\Framework\Event\ObserverInterface; คลาส MyObserver ใช้ ObserverInterface { ฟังก์ชั่นสาธารณะ __construct() { // รหัสเริ่มต้นของผู้สังเกตการณ์... // คุณสามารถใช้การพึ่งพาการฉีดเพื่อรับคลาสใด ๆ ที่ผู้สังเกตการณ์นี้อาจต้องการ } เรียกใช้ฟังก์ชันสาธารณะ (\Magento\Framework\Event\Observer $observer) { // รหัสดำเนินการของผู้สังเกตการณ์... } }
คุณลักษณะที่มีประสิทธิภาพอย่างหนึ่งของผู้สังเกตการณ์คือ พวกเขาสามารถใช้พารามิเตอร์ที่ส่งผ่านไปยังเหตุการณ์ได้เมื่อถูกส่งออกไป
นี่คือตัวอย่างของผู้สังเกตการณ์ที่ได้รับข้อมูลที่ส่งผ่านเมื่อเหตุการณ์ถูกส่ง:
เนมสเปซ MyCompany\MyModule\Observer; ใช้ Magento\Framework\Event\ObserverInterface; คลาส AnotherObserver ใช้ ObserverInterface { ฟังก์ชั่นสาธารณะ __construct() { // รหัสเริ่มต้นของผู้สังเกตการณ์... // คุณสามารถใช้การพึ่งพาการฉีดเพื่อรับคลาสใด ๆ ที่ผู้สังเกตการณ์นี้อาจต้องการ } เรียกใช้ฟังก์ชันสาธารณะ (\Magento\Framework\Event\Observer $observer) { $myEventData = $observer->getData('myEventData'); // รหัสการดำเนินการของผู้สังเกตการณ์เพิ่มเติม... } }
สมัครสมาชิกกิจกรรม
ผู้สังเกตการณ์สามารถกำหนดค่าเพื่อดูเหตุการณ์บางอย่างในไฟล์ events.xml
องค์ประกอบ xml ของผู้สังเกตการณ์มีคุณสมบัติดังต่อไปนี้:
- ชื่อ (จำเป็น) – ชื่อของผู้สังเกตการณ์สำหรับคำจำกัดความของเหตุการณ์
- อินสแตนซ์ (จำเป็น) – ชื่อคลาสแบบเต็มของผู้สังเกตการณ์
- ปิด การใช้งาน – กำหนดว่าผู้สังเกตการณ์นี้ใช้งานอยู่หรือไม่ ค่าเริ่มต้นเป็นเท็จ
- shared – กำหนดไลฟ์สไตล์ของชั้นเรียน ค่าเริ่มต้นเป็นจริง
ด้านล่างนี้คือตัวอย่างวิธีการกำหนดให้ผู้สังเกตการณ์ดูเหตุการณ์บางอย่าง:
<?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="my_module_event_before"> <observer name="myObserverName" instance="MyCompany\MyModule\Observer\MyObserver" /> </event> <event name="my_module_event_after"> <observer name="myObserverName" instance="MyCompany\MyModule\Observer\AnotherObserver" /> </event> </config>
โปรดทราบว่าชื่อผู้สังเกตการณ์ต้องไม่ซ้ำกันตามนิยามเหตุการณ์ คุณไม่สามารถมีผู้สังเกตการณ์สองคนที่มีชื่อเหมือนกันในข้อกำหนดเหตุการณ์เดียวกันเพื่อหลีกเลี่ยงการแทนที่
3. กิจกรรมจัดส่ง
สามารถส่งกิจกรรมได้โดยใช้คลาส Magento\Framework\Event\Manager คลาสนี้สามารถรับได้จากการฉีดการพึ่งพาโดยการกำหนดการพึ่งพาในตัวสร้างของคุณ
ในการส่งเหตุการณ์ ให้เรียกใช้ฟังก์ชันการจัดส่งของคลาสตัวจัดการเหตุการณ์และระบุชื่อเหตุการณ์ที่คุณต้องการจัดส่งพร้อมกับอาร์เรย์ของข้อมูลที่คุณต้องการให้กับผู้สังเกตการณ์
ตัวอย่างต่อไปนี้แสดงวิธีการจัดส่งเหตุการณ์ที่มีและไม่มีอาร์เรย์ของข้อมูล
เนมสเปซ MyCompany\MyModule; ใช้ Magento\Framework\Event\ManagerInterface เป็น EventManager; คลาส MyClass { /** * @var EventManager */ $eventManager ส่วนตัว; ฟังก์ชั่นสาธารณะ __construct (EventManager $eventManager) { $this->eventManager = $eventManager; } ฟังก์ชั่นสาธารณะบางสิ่งบางอย่าง() { $eventData = null; //รหัส... $this->eventManager->dispatch('my_module_event_before'); // รหัสเพิ่มเติมที่กำหนด $eventData... $this->eventManager->dispatch('my_module_event_after', ['myEventData' => $eventData]); } }
รายการกิจกรรม Magento 2
ไฟล์ | ชื่องาน |
app/code/Magento/Authorizenet/Controller/Directpost/Payment/Place.php | checkout_directpost_placeOrder |
app/code/Magento/Backend/Block/System/Store/Edit/AbstractForm.php | adminhtml_store_edit_form_prepare_form |
app/code/Magento/Backend/Block/Template.php | adminhtml_block_html_before |
app/code/Magento/Backend/Block/Widget/Grid.php | backend_block_widget_grid_prepare_grid_before |
app/code/Magento/Backend/Console/Command/CacheCleanCommand.php | adminhtml_cache_flush_system |
app/code/Magento/Backend/Console/Command/CacheFlushCommand.php | adminhtml_cache_flush_all |
app/code/Magento/Backend/Controller/Adminhtml/Cache/CleanImages.php | clean_catalog_images_cache_after |
app/code/Magento/Backend/Controller/Adminhtml/Cache/CleanMedia.php | clean_media_cache_after |
app/code/Magento/Backend/Controller/Adminhtml/Cache/CleanStaticFiles.php | clean_static_files_cache_after |
app/code/Magento/Backend/Controller/Adminhtml/Cache/FlushAll.php | adminhtml_cache_flush_all |
app/code/Magento/Backend/Controller/Adminhtml/Cache/FlushSystem.php | adminhtml_cache_flush_system |
app/code/Magento/Backend/Controller/Adminhtml/System/Design/Save.php | theme_save_after |
app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteStorePost.php | store_delete |
app/code/Magento/module-backend/Controller/Adminhtml/System/Store/Save.php | store_edit |
app/code/Magento/module-backend/Controller/Adminhtml/System/Store/Save.php | store_add |
app/code/Magento/Backend/Controller/Adminhtml/System/Store/Save.php | store_group_save |
app/code/Magento/Backend/Controller/Adminhtml/System/Store/Save.php | NO_MATCH |
app/code/Magento/Backend/Model/Auth.php | backend_auth_user_login_success |
app/code/Magento/Backend/Model/Auth.php | backend_auth_user_login_failed |
app/code/Magento/Backend/Model/Auth.php | backend_auth_user_login_failed |
app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle.php | Catalog_product_option_price_configuration_after |
app/code/Magento/Bundle/Model/Product/Price.php | prepare_catalog_product_collection_prices |
app/code/Magento/Bundle/Model/Product/Price.php | Catalog_product_get_final_price |
app/code/Magento/Bundle/Model/Product/Price.php | Catalog_product_get_final_price |
app/code/Magento/Bundle/Model/ResourceModel/Indexer/Price.php | Catalog_product_prepare_index_select |
app/code/Magento/Bundle/Pricing/Price/BundleSelectionPrice.php | Catalog_product_get_final_price |
app/code/Magento/Catalog/Block/Adminhtml/Category/Tab/Attributes.php | adminhtml_catalog_category_edit_prepare_form |
app/code/Magento/Catalog/Block/Adminhtml/Category/Tabs.php | adminhtml_catalog_category_tabs |
app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php | adminhtml_catalog_category_tree_is_moveable |
app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php | adminhtml_catalog_category_tree_can_add_root_category |
app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php | adminhtml_catalog_category_tree_can_add_sub_category |
app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Advanced.php | product_attribute_form_build |
app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Front.php | product_attribute_form_build_front_tab |
app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Front.php | adminhtml_catalog_product_attribute_edit_frontend_prepare_form |
app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Main.php | adminhtml_product_attribute_types |
app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Main.php | product_attribute_form_build_main_tab |
app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Grid.php | product_attribute_grid_build |
app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/NewAttribute/Product/Attributes.php | adminhtml_catalog_product_edit_prepare_form |
app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/NewAttribute/Product/Attributes.php | adminhtml_catalog_product_edit_element_types |
app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main.php | adminhtml_catalog_product_attribute_set_main_html_before |
app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Toolbar/Main.php | adminhtml_catalog_product_attribute_set_toolbar_main_html_before |
app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute/Tab/Attributes.php | adminhtml_catalog_product_form_prepare_excluded_field_list |
แอพ/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Attributes/Create.php | adminhtml_catalog_product_edit_tab_attributes_create_html_before |
app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Attributes.php | adminhtml_catalog_product_edit_prepare_form |
app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Attributes.php | adminhtml_catalog_product_edit_element_types |
app/code/Magento/Catalog/Block/Adminhtml/Product/Grid.php | adminhtml_catalog_product_grid_prepare_massaction |
app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Gallery/Content.php | Catalog_product_gallery_prepare_layout |
app/code/Magento/Catalog/Block/Product/AbstractProduct.php | Catalog_block_product_status_display |
app/code/Magento/Catalog/Block/Product/ListProduct.php | Catalog_block_product_list_collection |
app/code/Magento/Catalog/Block/Product/ProductList/Upsell.php | Catalog_product_upsale |
app/code/Magento/Catalog/Block/Product/View/Options.php | Catalog_product_option_price_configuration_after |
app/code/Magento/Catalog/Block/Product/View.php | Catalog_product_view_config |
app/code/Magento/Catalog/Block/Rss/Category.php | rss_catalog_category_xml_callback |
app/code/Magento/Catalog/Block/Rss/Product/NewProducts.php | rss_catalog_new_xml_callback |
app/code/Magento/Catalog/Block/Rss/Product/Special.php | rss_catalog_special_xml_callback |
app/code/Magento/Catalog/Block/ShortcutButtons.php | shortcut_buttons_container |
app/code/Magento/Catalog/Controller/Adminhtml/Category/Delete.php | Catalog_controller_category_delete |
app/code/Magento/Catalog/Controller/Adminhtml/Category/Edit.php | category_prepare_ajax_response |
app/code/Magento/Catalog/Controller/Adminhtml/Category/Save.php | Catalog_category_prepare_save |
app/code/Magento/Catalog/Controller/Adminhtml/Product/Action/Attribute/Save.php | Catalog_product_to_website_change |
app/code/Magento/Catalog/Controller/Adminhtml/Product/Edit.php | Catalog_product_edit_action |
app/code/Magento/Catalog/Controller/Adminhtml/Product/Gallery/Upload.php | Catalog_product_gallery_upload_image_after |
app/code/Magento/Catalog/Controller/Adminhtml/Product/NewAction.php | Catalog_product_new_action |
app/code/Magento/Catalog/Controller/Adminhtml/Product/Save.php | controller_action_catalog_product_save_entity_after |
app/code/Magento/Catalog/Controller/Category/View.php | Catalog_controller_category_init_after |
app/code/Magento/Catalog/Controller/Product/Compare/Add.php | Catalog_product_compare_add_product |
app/code/Magento/Catalog/Controller/Product/Compare/Remove.php | Catalog_product_compare_remove_product |
app/code/Magento/Catalog/Helper/Product/View.php | Catalog_controller_product_view |
app/code/Magento/Catalog/Helper/Product.php | Catalog_controller_product_init_before |
app/code/Magento/Catalog/Helper/Product.php | Catalog_controller_product_init_after |
app/code/Magento/Catalog/Model/Category.php | _move_before |
app/code/Magento/Catalog/Model/Category.php | _move_after |
app/code/Magento/Catalog/Model/Category.php | หมวดหมู่_move |
app/code/Magento/Catalog/Model/Product/Action.php | Catalog_product_attribute_update_before |
แอพ/code/Magento/Catalog/Model/Product/Attribute/Source/Inputtype.php | adminhtml_product_attribute_types |
app/code/Magento/Catalog/Model/Product/Type/AbstractType.php | Catalog_product_type_prepare_%s_options |
app/code/Magento/Catalog/Model/Product/Type/AbstractType.php | NO_MATCH |
app/code/Magento/Catalog/Model/Product/Type/Price.php | Catalog_product_get_final_price |
app/code/Magento/Catalog/Model/Product.php | _validate_before |
app/code/Magento/Catalog/Model/Product.php | _validate_after |
app/code/Magento/Catalog/Model/Product.php | Catalog_product_is_salable_before |
app/code/Magento/Catalog/Model/Product.php | Catalog_product_is_salable_after |
app/code/Magento/Catalog/Model/ResourceModel/Category/Collection.php | _load_before |
app/code/Magento/Catalog/Model/ResourceModel/Category/Collection.php | _load_after |
app/code/Magento/Catalog/Model/ResourceModel/Category/Collection.php | _add_is_active_filter |
แอพ/code/Magento/Catalog/Model/ResourceModel/Category/Flat/Collection.php | _load_before |
แอพ/code/Magento/Catalog/Model/ResourceModel/Category/Flat/Collection.php | _load_after |
แอพ/code/Magento/Catalog/Model/ResourceModel/Category/Flat/Collection.php | _add_is_active_filter |
app/code/Magento/Catalog/Model/ResourceModel/Category/Flat.php | Catalog_category_tree_init_inactive_category_ids |
app/code/Magento/Catalog/Model/ResourceModel/Category/Flat.php | Catalog_category_flat_loadnodes_before |
app/code/Magento/Catalog/Model/ResourceModel/Category/Tree.php | Catalog_category_tree_init_inactive_category_ids |
app/code/Magento/Catalog/Model/ResourceModel/Category.php | Catalog_category_change_products |
app/code/Magento/Catalog/Model/ResourceModel/Category.php | Catalog_category_delete_after_done |
app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php | Catalog_prepare_price_select |
app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php | Catalog_product_collection_load_after |
app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php | Catalog_product_collection_before_add_count_to_categories |
app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php | Catalog_product_collection_apply_limitations_after |
app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item/Collection.php | Catalog_product_compare_item_collection_clear |
app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/AbstractEav.php | prepare_catalog_product_index_select |
app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/Decimal.php | prepare_catalog_product_index_select |
app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/Source.php | prepare_catalog_product_index_select |
app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/Source.php | prepare_catalog_product_index_select |
แอพ/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/DefaultPrice.php | prepare_catalog_product_index_select |
app/code/Magento/Catalog/Model/ResourceModel/Product.php | Catalog_product_delete_after_done |
app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php | Catalog_prepare_price_select |
app/code/Magento/Catalog/Model/Rss/Product/NotifyStock.php | rss_catalog_notify_stock_collection_select |
app/code/Magento/Catalog/Plugin/Model/Product/Action/UpdateAttributesFlushCache.php | clean_cache_by_tags |
app/code/Magento/CatalogImportExport/Model/Import/Product.php | Catalog_product_import_bunch_delete_after |
app/code/Magento/CatalogImportExport/Model/Import/Product.php | Catalog_product_import_finish_before |
app/code/Magento/CatalogImportExport/Model/Import/Product.php | Catalog_product_import_bunch_save_after |
app/code/Magento/CatalogImportExport/Model/Import/Product.php | Catalog_product_import_bunch_delete_commit_before |
app/code/Magento/CatalogImportExport/Model/Import/Product.php | Catalog_product_import_bunch_delete_commit_after |
app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Catalog/Index.php | Catalogrule_dirty_notice |
app/code/Magento/CatalogInventory/Model/Indexer/Stock/AbstractAction.php | clean_cache_by_tags |
app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Catalog/Edit/Tab/Main.php | adminhtml_promo_catalog_edit_tab_main_prepare_form |
app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Catalog/Save.php | adminhtml_controller_catalogrule_prepare_save |
app/code/Magento/CatalogRule/Model/Indexer/AbstractIndexer.php | clean_cache_by_tags |
app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/DataProvider.php | catelogsearch_searchable_attributes_load_after |
app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/Full.php | catelogsearch_searchable_attributes_load_after |
app/code/Magento/CatalogSearch/Model/ResourceModel/Fulltext.php | Catalogsearch_reset_search_result |
app/code/Magento/Checkout/Block/QuoteShortcutButtons.php | shortcut_buttons_container |
app/code/Magento/Checkout/Controller/Cart/Add.php | checkout_cart_add_product_complete |
app/code/Magento/Checkout/Controller/Cart/UpdateItemOptions.php | checkout_cart_update_item_complete |
app/code/Magento/Checkout/Controller/Onepage/SaveOrder.php | checkout_controller_onepage_saveOrder |
app/code/Magento/Checkout/Controller/Onepage/Success.php | checkout_onepage_controller_success_action |
app/code/Magento/Checkout/Helper/Data.php | checkout_allow_guest |
app/code/Magento/Checkout/Model/Cart.php | checkout_cart_product_add_after |
app/code/Magento/Checkout/Model/Cart.php | ชำระเงิน_cart_update_items_before |
app/code/Magento/Checkout/Model/Cart.php | checkout_cart_update_items_after |
app/code/Magento/Checkout/Model/Cart.php | checkout_cart_save_before |
app/code/Magento/Checkout/Model/Cart.php | checkout_cart_save_after |
app/code/Magento/Checkout/Model/Cart.php | checkout_cart_product_update_after |
app/code/Magento/Checkout/Model/Session.php | custom_quote_process |
app/code/Magento/Checkout/Model/Session.php | checkout_quote_init |
app/code/Magento/Checkout/Model/Session.php | load_customer_quote_before |
app/code/Magento/Checkout/Model/Session.php | เช็คเอาต์_quote_destroy |
app/code/Magento/Checkout/Model/Session.php | restore_quote |
app/code/Magento/Checkout/Model/Type/Onepage.php | checkout_type_onepage_save_order_after |
app/code/Magento/Checkout/Model/Type/Onepage.php | checkout_submit_all_after |
app/code/Magento/Cms/Block/Adminhtml/Page/Edit/Tab/Content.php | adminhtml_cms_page_edit_tab_content_prepare_form |
แอพ/code/Magento/Cms/Block/Adminhtml/Page/Edit/Tab/Design.php | adminhtml_cms_page_edit_tab_design_prepare_form |
app/code/Magento/Cms/Block/Adminhtml/Page/Edit/Tab/Main.php | adminhtml_cms_page_edit_tab_main_prepare_form |
app/code/Magento/Cms/Block/Adminhtml/Page/Edit/Tab/Meta.php | adminhtml_cms_page_edit_tab_meta_prepare_form |
app/code/Magento/Cms/Controller/Adminhtml/Page/Delete.php | adminhtml_cmspage_on_delete |
app/code/Magento/Cms/Controller/Adminhtml/Page/Delete.php | adminhtml_cmspage_on_delete |
app/code/Magento/Cms/Controller/Adminhtml/Page/Save.php | cms_page_prepare_save |
app/code/Magento/Cms/Controller/Router.php | cms_controller_router_match_before |
app/code/Magento/Cms/Helper/Page.php | cms_page_render |
app/code/Magento/Cms/Helper/Wysiwyg/Images.php | cms_wysiwyg_images_static_urls_allowed |
แอพ/รหัส/Magento/Config/Block/System/Config/Form/Fieldset/Modules/DisableOutput.php | adminhtml_system_config_advanced_disableoutput_render_before |
app/code/Magento/Config/Model/Config.php | NO_MATCH |
app/code/Magento/ConfigurableProduct/Model/Product/Validator/Plugin.php | Catalog_product_validate_variations_before |
app/code/Magento/Cookie/Controller/Index/NoCookies.php | controller_action_nocookies |
app/code/Magento/CurrencySymbol/Model/System/Currencysymbol.php | admin_system_config_changed_section_currency_before_reinit |
app/code/Magento/CurrencySymbol/Model/System/Currencysymbol.php | admin_system_config_changed_section_currency |
app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Carts.php | adminhtml_block_html_before |
app/code/Magento/Customer/Controller/Account/CreatePost.php | ลูกค้า_register_success |
app/code/Magento/Customer/Controller/Account/EditPost.php | ลูกค้า_account_edited |
app/code/Magento/Customer/Controller/Adminhtml/Index/Save.php | adminhtml_customer_prepare_save |
app/code/Magento/Customer/Controller/Adminhtml/Index/Save.php | adminhtml_customer_save_after |
app/code/Magento/Customer/Model/AccountManagement.php | ลูกค้า_customer_authenticated |
app/code/Magento/Customer/Model/AccountManagement.php | ลูกค้า_data_object_login |
app/code/Magento/Customer/Model/Address/AbstractAddress.php | customer_address_format |
app/code/Magento/Customer/Model/Customer.php | ลูกค้า_customer_authenticated |
app/code/Magento/Customer/Model/Customer.php | customer_validate |
app/code/Magento/Customer/Model/ResourceModel/CustomerRepository.php | ลูกค้า_save_after_data_object |
app/code/Magento/Customer/Model/Session.php | ลูกค้า_session_init |
app/code/Magento/Customer/Model/Session.php | customer_login |
app/code/Magento/Customer/Model/Session.php | ลูกค้า_data_object_login |
app/code/Magento/Customer/Model/Session.php | customer_login |
app/code/Magento/Customer/Model/Session.php | ลูกค้า_data_object_login |
app/code/Magento/Customer/Model/Session.php | customer_logout |
app/code/Magento/Customer/Model/Visitor.php | visitor_init |
app/code/Magento/Customer/Model/Visitor.php | visitor_activity_save |
app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Main/AbstractMain.php | adminhtml_block_eav_attribute_edit_form_init |
app/code/Magento/Eav/Model/Entity/Collection/AbstractCollection.php | eav_collection_abstract_load_before |
app/code/Magento/GiftMessage/Block/Message/Inline.php | gift_options_prepare_items |
แอพ/code/Magento/GroupedProduct/Model/ResourceModel/Product/Indexer/Price/Grouped.php | Catalog_product_prepare_index_select |
app/code/Magento/Indexer/Model/Processor/InvalidateCache.php | clean_cache_after_reindex |
app/code/Magento/Multishipping/Controller/Checkout/ShippingPost.php | checkout_controller_multishipping_shipping_post |
app/code/Magento/Multishipping/Controller/Checkout/Success.php | multishipping_checkout_controller_success_action |
app/code/Magento/Multishipping/Model/Checkout/Type/Multishipping.php | checkout_type_multishipping_set_shipping_items |
app/code/Magento/Multishipping/Model/Checkout/Type/Multishipping.php | checkout_type_multishipping_create_orders_single |
app/code/Magento/Multishipping/Model/Checkout/Type/Multishipping.php | checkout_submit_all_after |
app/code/Magento/Multishipping/Model/Checkout/Type/Multishipping.php | checkout_multishipping_refund_all |
app/code/Magento/PageCache/Model/Cache/Type.php | adminhtml_cache_refresh_type |
แอพ/code/Magento/PageCache/Model/Layout/DepersonalizePlugin.php | depersonalize_clear_session |
app/code/Magento/Payment/Block/Form/Cc.php | payment_form_block_to_html_before |
app/code/Magento/Payment/Model/Cart.php | payment_cart_collect_items_and_amounts |
app/code/Magento/Payment/Model/Method/AbstractMethod.php | payment_method_is_active |
app/code/Magento/Payment/Model/Method/Adapter.php | payment_method_is_active |
app/code/Magento/Payment/Model/Method/Adapter.php | การชำระเงิน_method_assign_data_ |
app/code/Magento/Paypal/Controller/Express/AbstractExpress/PlaceOrder.php | paypal_express_place_order_success |
app/code/Magento/Persistent/Controller/Index/UnsetCookie.php | ถาวร_เซสชั่น_หมดอายุ |
app/code/Magento/Persistent/Observer/CheckExpirePersistentQuoteObserver.php | ถาวร_เซสชั่น_หมดอายุ |
app/code/Magento/Quote/Model/Cart/Totals/ItemConverter.php | items_additional_data |
app/code/Magento/Quote/Model/Quote/Address/ToOrder.php | sales_convert_quote_to_order |
app/code/Magento/Quote/Model/Quote/Item.php | sales_quote_item_qty_set_after |
app/code/Magento/Quote/Model/Quote/Item.php | sales_quote_item_set_product |
app/code/Magento/Quote/Model/Quote/Payment.php | _import_data_before |
app/code/Magento/Quote/Model/Quote/TotalsCollector.php | sales_quote_collect_totals_before |
app/code/Magento/Quote/Model/Quote/TotalsCollector.php | sales_quote_collect_totals_after |
app/code/Magento/Quote/Model/Quote/TotalsCollector.php | sales_quote_address_collect_totals_before |
app/code/Magento/Quote/Model/Quote/TotalsCollector.php | sales_quote_address_collect_totals_after |
app/code/Magento/Quote/Model/Quote.php | sales_quote_remove_item |
app/code/Magento/Quote/Model/Quote.php | sales_quote_add_item |
app/code/Magento/Quote/Model/Quote.php | sales_quote_product_add_after |
app/code/Magento/Quote/Model/Quote.php | _merge_before |
app/code/Magento/Quote/Model/Quote.php | _merge_after |
app/code/Magento/Quote/Model/QuoteManagement.php | checkout_submit_before |
app/code/Magento/Quote/Model/QuoteManagement.php | checkout_submit_all_after |
app/code/Magento/Quote/Model/QuoteManagement.php | sales_model_service_quote_submit_before |
app/code/Magento/Quote/Model/QuoteManagement.php | sales_model_service_quote_submit_success |
app/code/Magento/Quote/Model/QuoteManagement.php | sales_model_service_quote_submit_failure |
app/code/Magento/Quote/Model/ResourceModel/Quote/Address/Collection.php | _load_after |
app/code/Magento/Quote/Model/ResourceModel/Quote/Item/Collection.php | prepare_catalog_product_collection_prices |
app/code/Magento/Quote/Model/ResourceModel/Quote/Item/Collection.php | sales_quote_item_collection_products_after_load |
app/code/Magento/Reports/Block/Adminhtml/Grid.php | adminhtml_widget_grid_filter_collection |
app/code/Magento/Reports/Model/ResourceModel/Order/Collection.php | sales_prepare_amount_expression |
app/code/Magento/Review/Controller/Product.php | review_controller_product_init_before |
app/code/Magento/Review/Controller/Product.php | review_controller_product_init |
app/code/Magento/Review/Controller/Product.php | review_controller_product_init_after |
app/code/Magento/Review/Model/ResourceModel/Rating/Collection.php | Rating_rating_collection_load_before |
app/code/Magento/Review/Model/ResourceModel/Review/Collection.php | review_review_collection_load_before |
app/code/Magento/Review/Model/Rss.php | rss_catalog_review_collection_select |
app/code/Magento/Sales/Block/Adminhtml/Reorder/Renderer/Action.php | adminhtml_customer_orders_add_action_renderer |
app/code/Magento/Sales/Controller/Adminhtml/Order/AddressSave.php | admin_sales_order_address_update |
app/code/Magento/Sales/Controller/Adminhtml/Order/Create.php | adminhtml_sales_order_create_process_data_before |
app/code/Magento/Sales/Controller/Adminhtml/Order/Create.php | adminhtml_sales_order_create_process_data |
app/code/Magento/Sales/Controller/Adminhtml/Order/CreditmemoLoader.php | adminhtml_sales_order_creditmemo_register_before |
app/code/Magento/Sales/Model/AdminOrder/Create.php | sales_convert_order_to_quote |
app/code/Magento/Sales/Model/AdminOrder/Create.php | sales_convert_order_item_to_quote_item |
app/code/Magento/Sales/Model/AdminOrder/Create.php | checkout_submit_all_after |
app/code/Magento/Sales/Model/Config/Backend/Email/AsyncSending.php | sales_email_general_async_sending |
app/code/Magento/Sales/Model/Config/Backend/Grid/AsyncIndexing.php | dev_grid_async_indexing |
app/code/Magento/Sales/Model/Order/Address/Renderer.php | customer_address_format |
แอพ/code/Magento/Sales/Model/Order/Email/Sender/CreditmemoCommentSender.php | email_creditmemo_comment_set_template_vars_before |
แอพ/code/Magento/Sales/Model/Order/Email/Sender/CreditmemoSender.php | email_creditmemo_set_template_vars_before |
แอพ/code/Magento/Sales/Model/Order/Email/Sender/InvoiceCommentSender.php | email_invoice_comment_set_template_vars_before |
แอพ/code/Magento/Sales/Model/Order/Email/Sender/InvoiceSender.php | email_invoice_set_template_vars_before |
แอพ/code/Magento/Sales/Model/Order/Email/Sender/OrderCommentSender.php | email_order_comment_set_template_vars_before |
app/code/Magento/Sales/Model/Order/Email/Sender/OrderSender.php | email_order_set_template_vars_before |
แอพ/code/Magento/Sales/Model/Order/Email/Sender/ShipmentCommentSender.php | email_shipment_comment_set_template_vars_before |
app/code/Magento/Sales/Model/Order/Email/Sender/ShipmentSender.php | email_shipment_set_template_vars_before |
app/code/Magento/Sales/Model/Order/Invoice.php | sales_order_invoice_pay |
app/code/Magento/Sales/Model/Order/Invoice.php | sales_order_invoice_cancel |
app/code/Magento/Sales/Model/Order/Invoice.php | sales_order_invoice_register |
app/code/Magento/Sales/Model/Order/Item.php | sales_order_item_cancel |
app/code/Magento/Sales/Model/Order/Payment/Operations/CaptureOperation.php | sales_order_payment_capture |
app/code/Magento/Sales/Model/Order.php | sales_order_load_after |
app/code/Magento/Sales/Model/Order.php | sales_order_save_before |
app/code/Magento/Sales/Model/Order.php | sales_order_save_after |
app/code/Magento/Sales/Model/Order.php | sales_order_delete_before |
app/code/Magento/Sales/Model/Order.php | sales_order_invoice_load_after |
app/code/Magento/Sales/Model/Order.php | sales_order_invoice_load_before |
app/code/Magento/Sales/Model/Order.php | sales_order_shipment_load_after |
app/code/Magento/Sales/Model/Order.php | sales_order_shipment_load_before |
app/code/Magento/Sales/Model/Order.php | sales_order_creditmemo_load_after |
app/code/Magento/Sales/Model/Order.php | sales_order_creditmemo_load_before |
app/code/Magento/Sales/Model/Order.php | sales_order_grid_collection_load_before |
app/code/Magento/Sales/Observer/GridSyncInsertObserver.php | sales_order_invoice_save_after |
app/code/Magento/Sales/Observer/GridSyncInsertObserver.php | sales_order_shipment_save_after |
app/code/Magento/Sales/Observer/GridSyncInsertObserver.php | sales_order_creditmemo_save_after |
app/code/Magento/Sales/Model/Order/Payment/Transaction.php | _html_txn_id |
app/code/Magento/Sales/Model/Order/Payment.php | sales_order_payment_place_start |
app/code/Magento/Sales/Model/Order/Payment.php | sales_order_payment_place_end |
app/code/Magento/Sales/Model/Order/Payment.php | sales_order_payment_pay |
app/code/Magento/Sales/Model/Order/Payment.php | sales_order_payment_cancel_invoice |
app/code/Magento/Sales/Model/Order/Payment.php | sales_order_payment_void |
app/code/Magento/Sales/Model/Order/Payment.php | sales_order_payment_refund |
app/code/Magento/Sales/Model/Order/Payment.php | sales_order_payment_cancel_creditmemo |
app/code/Magento/Sales/Model/Order/Payment.php | sales_order_payment_cancel |
app/code/Magento/Sales/Model/Order/Status.php | sales_order_status_unassign |
app/code/Magento/Sales/Model/Order.php | sales_order_place_before |
app/code/Magento/Sales/Model/Order.php | sales_order_place_after |
app/code/Magento/Sales/Model/Order.php | order_cancel_after |
app/code/Magento/Sales/Model/ResourceModel/Attribute.php | _save_attribute_before |
app/code/Magento/Sales/Model/ResourceModel/Attribute.php | _save_attribute_after |
app/code/Magento/Sales/Model/ResourceModel/Order/Address/Collection.php | _load_after |
แอพ/code/Magento/Sales/Model/ResourceModel/Order/Collection/AbstractCollection.php | _set_sales_order |
app/code/Magento/Sales/Model/ResourceModel/Sale/Collection.php | sales_sale_collection_query_before |
app/code/Magento/Sales/Model/Rss/NewOrder.php | rss_order_new_collection_select |
app/code/Magento/Sales/Model/Service/CreditmemoService.php | sales_order_creditmemo_cancel |
app/code/Magento/Sales/Model/Service/CreditmemoService.php | sales_order_creditmemo_refund |
app/code/Magento/Sales/Model/Service/OrderService.php | sales_order_state_change_before |
แอพ/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Actions.php | adminhtml_block_salesrule_actions_prepareform |
แอพ/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Coupons/Form.php | adminhtml_promo_quote_edit_tab_coupons_form_prepare_form |
แอพ/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Main.php | adminhtml_promo_quote_edit_tab_main_prepare_form |
แอพ/code/Magento/SalesRule/Block/Adminhtml/Promo/Widget/Chooser.php | adminhtml_block_promo_widget_chooser_prepare_collection |
แอพ/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/Save.php | adminhtml_controller_salesrule_prepare_save |
app/code/Magento/SalesRule/Model/Quote/Discount.php | sales_quote_address_discount_item |
app/code/Magento/SalesRule/Model/Quote/Discount.php | sales_quote_address_discount_item |
app/code/Magento/SalesRule/Model/Rule/Condition/Combine.php | salesrule_rule_condition_combine |
app/code/Magento/SalesRule/Model/Rule.php | salesrule_rule_get_coupon_types |
app/code/Magento/SalesRule/Model/RulesApplier.php | salesrule_validator_process |
app/code/Magento/Search/Controller/Adminhtml/Term/Report.php | on_view_report |
app/code/Magento/SendFriend/Controller/Product/Send.php | sendfriend_product |
app/code/Magento/Store/Model/Address/Renderer.php | store_address_format |
app/code/Magento/Swatches/Controller/Adminhtml/Iframe/Show.php | swatch_gallery_upload_image_after |
app/code/Magento/Tax/Controller/Adminhtml/Tax/IgnoreTaxNotification.php | adminhtml_cache_refresh_type |
app/code/Magento/Tax/Model/Calculation/Rate.php | tax_settings_change_after |
app/code/Magento/Tax/Model/Calculation/Rate.php | tax_settings_change_after |
app/code/Magento/Tax/Model/Calculation/Rate.php | tax_settings_change_after |
app/code/Magento/Tax/Model/Calculation/Rule.php | tax_settings_change_after |
app/code/Magento/Tax/Model/Calculation/Rule.php | tax_settings_change_after |
app/code/Magento/Tax/Model/Calculation.php | tax_rate_data_fetch |
app/code/Magento/Theme/Block/Html/Topmenu.php | page_block_html_topmenu_gethtml_before |
app/code/Magento/Theme/Block/Html/Topmenu.php | page_block_html_topmenu_gethtml_after |
app/code/Magento/Theme/Model/Config.php | assign_theme_to_stores_after |
app/code/Magento/Theme/Observer/CheckThemeIsAssignedObserver.php | มอบหมาย_theme_changed |
app/code/Magento/Theme/Setup/InstallData.php | theme_registration_from_filesystem |
app/code/Magento/User/Block/Role.php | สิทธิ์_role_html_before |
app/code/Magento/User/Controller/Adminhtml/User/Role/SaveRole.php | admin_permissions_role_prepare_save |
app/code/Magento/User/Model/User.php | admin_user_authenticate_before |
app/code/Magento/User/Model/User.php | admin_user_authenticate_after |
แอพ/code/Magento/Wishlist/Block/Customer/Wishlist/Item/Options.php | product_option_renderer_init |
app/code/Magento/Wishlist/Controller/Index/Add.php | สิ่งที่อยากได้_add_product |
app/code/Magento/Wishlist/Controller/Index/Send.php | สิ่งที่อยากได้_share |
app/code/Magento/Wishlist/Controller/Index/UpdateItemOptions.php | สิ่งที่อยากได้_update_item |
app/code/Magento/Wishlist/Helper/Data.php | Wishlist_items_renewed |
app/code/Magento/Wishlist/Model/ResourceModel/Item/Collection.php | Wishlist_item_collection_products_after_load |
app/code/Magento/Wishlist/Model/Rss/Wishlist.php | rss_wishlist_xml_callback |
app/code/Magento/Wishlist/Model/Wishlist.php | สิ่งที่อยากได้_add_item |
app/code/Magento/Wishlist/Model/Wishlist.php | สิ่งที่อยากได้_product_add_after |
lib/internal/Magento/Framework/App/Action/Action.php | controller_action_predispatch |
lib/internal/Magento/Framework/App/Action/Action.php | controller_action_predispatch_ |
lib/internal/Magento/Framework/App/Action/Action.php | controller_action_predispatch_ |
lib/internal/Magento/Framework/App/Action/Action.php | controller_action_postdispatch_ |
lib/internal/Magento/Framework/App/Action/Action.php | controller_action_postdispatch_ |
lib/internal/Magento/Framework/App/Action/Action.php | controller_action_postdispatch |
lib/internal/Magento/Framework/App/Cron.php | ค่าเริ่มต้น |
lib/internal/Magento/Framework/App/FrontController.php | NO_MATCH |
lib/internal/Magento/Framework/App/Http.php | NO_MATCH |
lib/internal/Magento/Framework/App/Http.php | controller_front_send_response_before |
lib/internal/Magento/Framework/App/View.php | controller_action_layout_render_before |
lib/internal/Magento/Framework/App/View.php | controller_action_layout_render_before_ |
lib/internal/Magento/Framework/Controller/Noroute/Index.php | controller_action_noroute |
lib/internal/Magento/Framework/Data/AbstractSearchResult.php | abstract_search_result_load_before |
lib/internal/Magento/Framework/Data/AbstractSearchResult.php | _load_before |
lib/internal/Magento/Framework/Data/AbstractSearchResult.php | abstract_search_result_load_after |
lib/internal/Magento/Framework/Data/AbstractSearchResult.php | _load_after |
lib/internal/Magento/Framework/DataObject/Copy.php | NO_MATCH |
lib/internal/Magento/Framework/Event/Collection.php | NO_MATCH |
lib/internal/Magento/Framework/Event/Manager.php | NO_MATCH |
lib/internal/Magento/Framework/Event/Observer/Collection.php | NO_MATCH |
lib/internal/Magento/Framework/Event.php | NO_MATCH |
lib/internal/Magento/Framework/Locale/Currency.php | currency_display_options_forming |
lib/internal/Magento/Framework/Message/Manager.php | session_abstract_clear_messages |
lib/internal/Magento/Framework/Message/Manager.php | session_abstract_add_message |
lib/internal/Magento/Framework/Model/AbstractModel.php | model_load_before |
lib/internal/Magento/Framework/Model/AbstractModel.php | _load_before |
lib/internal/Magento/Framework/Model/AbstractModel.php | model_load_after |
lib/internal/Magento/Framework/Model/AbstractModel.php | _load_after |
lib/internal/Magento/Framework/Model/AbstractModel.php | model_save_commit_after |
lib/internal/Magento/Framework/Model/AbstractModel.php | _save_commit_after |
lib/internal/Magento/Framework/Model/AbstractModel.php | model_save_before |
lib/internal/Magento/Framework/Model/AbstractModel.php | _save_before |
lib/internal/Magento/Framework/Model/AbstractModel.php | model_save_after |
lib/internal/Magento/Framework/Model/AbstractModel.php | clean_cache_by_tags |
lib/internal/Magento/Framework/Model/AbstractModel.php | _save_after |
lib/internal/Magento/Framework/Model/AbstractModel.php | model_delete_before |
lib/internal/Magento/Framework/Model/AbstractModel.php | _delete_before |
lib/internal/Magento/Framework/Model/AbstractModel.php | model_delete_after |
lib/internal/Magento/Framework/Model/AbstractModel.php | clean_cache_by_tags |
lib/internal/Magento/Framework/Model/AbstractModel.php | _delete_after |
lib/internal/Magento/Framework/Model/AbstractModel.php | model_delete_commit_after |
lib/internal/Magento/Framework/Model/AbstractModel.php | _delete_commit_after |
lib/internal/Magento/Framework/Model/AbstractModel.php | _clear |
lib/internal/Magento/Framework/Model/ResourceModel/Db/Collection/AbstractCollection.php | core_collection_abstract_load_before |
lib/internal/Magento/Framework/Model/ResourceModel/Db/Collection/AbstractCollection.php | _load_before |
lib/internal/Magento/Framework/Model/ResourceModel/Db/Collection/AbstractCollection.php | core_collection_abstract_load_after |
lib/internal/Magento/Framework/Model/ResourceModel/Db/Collection/AbstractCollection.php | _load_after |
lib/internal/Magento/Framework/Model/ResourceModel/Db/VersionControl/RelationComposite.php | _process_relation |
lib/internal/Magento/Framework/View/Element/AbstractBlock.php | view_block_abstract_to_html_before |
lib/internal/Magento/Framework/View/Element/Messages.php | view_message_block_render_grouped_html_after |
lib/internal/Magento/Framework/View/Layout/Builder.php | layout_load_before |
lib/internal/Magento/Framework/View/Layout/Builder.php | layout_generate_blocks_before |
lib/internal/Magento/Framework/View/Layout/Builder.php | layout_generate_blocks_after |
lib/internal/Magento/Framework/View/Layout/Generator/Block.php | core_layout_block_create_after |
lib/internal/Magento/Framework/View/Layout.php | core_layout_render_element |
lib/internal/Magento/Framework/View/Result/Layout.php | layout_render_before |
lib/internal/Magento/Framework/View/Result/Layout.php | layout_render_before_ |
See also:
วิธีเปิดใช้งานโหมดนักพัฒนาซอฟต์แวร์ใน Magento 2
วิธีรับ URL รูปภาพผลิตภัณฑ์ใน Magento 2