|
|
před 2 roky | |
|---|---|---|
| .. | ||
| Api | před 2 roky | |
| Block | před 2 roky | |
| Console/Command | před 2 roky | |
| Controller | před 2 roky | |
| CustomerData | před 2 roky | |
| Helper | před 2 roky | |
| Model | před 2 roky | |
| Observer | před 2 roky | |
| Plugin/Webapi/Controller/Rest | před 2 roky | |
| Setup | před 2 roky | |
| Test | před 2 roky | |
| Ui/Component | před 2 roky | |
| ViewModel | před 2 roky | |
| etc | před 2 roky | |
| i18n | před 2 roky | |
| view | před 2 roky | |
| LICENSE.txt | před 2 roky | |
| LICENSE_AFL.txt | před 2 roky | |
| README.md | před 2 roky | |
| composer.json | před 2 roky | |
| registration.php | před 2 roky | |
This module serves to handle the customer data (Customer, Customer Address and Customer Group entities) both in the admin panel and the storefront. For customer passwords, the module implements upgrading hashes.
The Magento_Customer module is one of the base Magento 2 modules. You cannot disable or uninstall this module. This module is dependent on the following modules:
Magento_EavMagento_DirectoryThe following modules depend on this module:
Magento_CaptchaMagento_CatalogMagento_CatalogCustomerGraphQlMagento_CatalogRuleMagento_CompareListGraphQlMagento_CustomerAnalyticsMagento_CustomerGraphQlMagento_EncryptionKeyMagento_LoginAsCustomerGraphQlMagento_NewRelicReportingMagento_ProductAlertMagento_ReportsMagento_SalesMagento_SwatchesMagento_TaxMagento_WishlistMagento_WishlistGraphQlThe Magento_Customer module creates the following tables in the database:
customer_entitycustomer_entity_datetimecustomer_entity_decimalcustomer_entity_intcustomer_entity_textcustomer_entity_varcharcustomer_address_entitycustomer_address_entity_datetimecustomer_address_entity_decimalcustomer_address_entity_intcustomer_address_entity_textcustomer_address_entity_varcharcustomer_groupcustomer_eav_attributecustomer_form_attributecustomer_eav_attribute_websitecustomer_visitorcustomer_logFor information about a module installation in Magento 2, see Enable or disable modules.
Extension developers can interact with the Magento_Customer module. For more information about the Magento extension mechanism, see Magento plugins.
The Magento dependency injection mechanism enables you to override the functionality of the Magento_Customer module.
A lot of functionality in the module is on JavaScript, use mixins to extend it.
The module dispatches the following events:
adminhtml_block_html_before event in the \Magento\Customer\Block\Adminhtml\Edit\Tab\Carts::_toHtml method. Parameters:
block is a $this object (Magento\Customer\Block\Adminhtml\Edit\Tab\Carts class)customer_register_success event in the \Magento\Customer\Controller\Account\CreatePost::execute method. Parameters:
account_controller is a $this object (\Magento\Customer\Controller\Account\CreatePost class)customer is a customer object (\Magento\Customer\Model\Data\Customer class)customer_account_edited event in the \Magento\Customer\Controller\Account\EditPost::dispatchSuccessEvent method. Parameters:
email is a customer email (string type)adminhtml_customer_prepare_save event in the \Magento\Customer\Controller\Adminhtml\Index\Save::execute method. Parameters:
customer is a customer object to be saved (\Magento\Customer\Model\Data\Customer class)request is a request object with the \Magento\Framework\App\RequestInterface interface.adminhtml_customer_save_after event in the \Magento\Customer\Controller\Adminhtml\Index\Save::execute method. Parameters:
customer is a customer object (\Magento\Customer\Model\Data\Customer class)request is a request object with the \Magento\Framework\App\RequestInterface interface.customer_customer_authenticated event in the \Magento\Customer\Model\AccountManagement::authenticate method. Parameters:
model is a customer object (\Magento\Customer\Model\Customer class)password is a customer password (string type)customer_data_object_login event in the \Magento\Customer\Model\AccountManagement::authenticate method. Parameters:
customer is a customer object (\Magento\Customer\Model\Data\Customer class)customer_address_format event in the \Magento\Customer\Model\Address\AbstractAddress::format method. Parameters:
type is a address format type (string type)address is a $this object (\Magento\Customer\Model\Address\AbstractAddress class)customer_customer_authenticated event in the \Magento\Customer\Model\Customer::authenticate method. Parameters:
model is a customer object (\Magento\Customer\Model\Customer class)password is a customer password (string type)customer_save_after_data_object event in the \Magento\Customer\Model\ResourceModel\CustomerRepository::save method. Parameters:
customer_data_object is a saved customer object (\Magento\Customer\Model\Data\Customer class)orig_customer_data_object is a previous customer object (\Magento\Customer\Model\Data\Customer class)delegate_data is a customer additional data (array type)customer_session_init event in the \Magento\Customer\Model\Session::__construct method. Parameters:
customer_session is a $this object (\Magento\Customer\Model\Session class)customer_login event in the \Magento\Customer\Model\Session::setCustomerAsLoggedIn method. Parameters:
customer is a $this object (\Magento\Customer\Model\Customer class)customer_data_object_login event in the \Magento\Customer\Model\Session::setCustomerAsLoggedIn method. Parameters:
customer is a $this object (\Magento\Customer\Model\Data\Customer class)customer_login event in the \Magento\Customer\Model\Session::setCustomerDataAsLoggedIn method. Parameters:
customer is a $this object (\Magento\Customer\Model\Customer class)customer_data_object_login event in the \Magento\Customer\Model\Session::setCustomerDataAsLoggedIn method. Parameters:
customer is a $this object (\Magento\Customer\Model\Data\Customer class)customer_logout event in the \Magento\Customer\Model\Session::logout method. Parameters:
customer is a $this object (\Magento\Customer\Model\Customer class)visitor_init event in the \Magento\Customer\Model\Visitor::logout method. Parameters:
visitor is a $this object (\Magento\Customer\Model\Visitor class)visitor_activity_save event in the \Magento\Customer\Model\Visitor::saveByRequest method. Parameters:
visitor is a $this object (\Magento\Customer\Model\Visitor class)For information about an event in Magento 2, see Events and observers.
This module introduces the following layouts in the view/frontend/layout and view/adminhtml/layout directories:
view/adminhtml/layout:
customer_address_editcustomer_group_indexcustomer_index_cartcustomer_index_cartscustomer_index_editcustomer_index_indexcustomer_index_newslettercustomer_index_orderscustomer_index_viewcartcustomer_index_viewwishlistcustomer_online_indexview/frontend/layout:
customer_accountcustomer_account_confirmationcustomer_account_createcustomer_account_createpasswordcustomer_account_editcustomer_account_forgotpasswordcustomer_account_indexcustomer_account_logincustomer_account_logoutsuccesscustomer_address_indexdefaultFor more information about a layout in Magento 2, see the Layout documentation.
\Magento\Customer\Api\Data\AddressInterface:
\Magento\Customer\Api\Data\AddressSearchResultsInterface:
\Magento\Customer\Api\Data\AttributeMetadataInterface:
\Magento\Customer\Api\Data\CustomerInterface:
\Magento\Customer\Api\Data\CustomerSearchResultsInterface:
\Magento\Customer\Api\Data\GroupInterface:
\Magento\Customer\Api\Data\GroupSearchResultsInterface:
\Magento\Customer\Api\Data\OptionInterface:
\Magento\Customer\Api\Data\RegionInterface:
\Magento\Customer\Api\Data\ValidationResultsInterface:
\Magento\Customer\Api\Data\ValidationRuleInterface:
\Magento\Customer\Api\MetadataInterface:
\Magento\Customer\Api\MetadataManagementInterface:
\Magento\Customer\Api\AddressMetadataInterface:
Magento\Customer\MetadataInterface\Magento\Customer\Api\AddressMetadataManagementInterface:
Magento\Customer\Api\MetadataManagementInterface\Magento\Customer\Api\AddressRepositoryInterface:
\Magento\Customer\Model\Address\AddressModelInterface
\Magento\Customer\Model\Address\ValidatorInterface
\Magento\Customer\Model\Address\CustomAttributeListInterface
\Magento\Customer\Api\AccountManagementInterface:
\Magento\Customer\Api\CustomerManagementInterface:
\Magento\Customer\Api\CustomerMetadataInterface:
Magento\Customer\MetadataInterface\Magento\Customer\Api\CustomerMetadataManagementInterface:
Magento\Customer\Api\MetadataManagementInterface\Magento\Customer\Api\CustomerNameGenerationInterface:
\Magento\Customer\Api\CustomerRepositoryInterface:
\Magento\Customer\Model\AuthenticationInterface:
\Magento\Customer\Model\EmailNotificationInterface:
\Magento\Customer\Api\CustomerGroupConfigInterface:
\Magento\Customer\Api\GroupManagementInterface:
\Magento\Customer\Api\GroupRepositoryInterface:
\Magento\Customer\Model\Group\RetrieverInterface
\Magento\Customer\Model\Customer\Source\GroupSourceLoggedInOnlyInterface
For information about a public API in Magento 2, see Public interfaces & APIs.
You can extend customer and customer address updates using the configuration files located in the view/adminhtml/ui_component and view/base/ui_component directories:
view/adminhtml/ui_component:
customer_address_formcustomer_address_listingcustomer_group_listingcustomer_listingcustomer_online_gridview/base/ui_component:
customer_formFor information about a UI component in Magento 2, see Overview of UI components.
More information can get at articles:
Magento_Customer provides console commands:
bin/magento customer:hash:upgrade - upgrades a customer password hash to the latest hash algorithmCron group configuration can be set at etc/crontab.xml:
visitor_clean - clean visitor’s outdated recordsLearn how to configure and run cron in Magento..
This module introduces the following indexers:
customer_grid - customer grid indexer