This commit is contained in:
2026-09-15 10:26:34 +08:00
commit ecf36afa56
10493 changed files with 1404888 additions and 0 deletions
@@ -0,0 +1,72 @@
<?xml version="1.0" ?>
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
<table name="customer_address_entity">
<column name="city_code" nullable="true" xsi:type="int" comment="City"/>
<column name="district_code" nullable="true" xsi:type="int" comment="District"/>
<column name="district" nullable="true" xsi:type="varchar" comment="District"/>
<column name="town_code" nullable="true" xsi:type="int" comment="Town"/>
<column name="town" nullable="true" xsi:type="varchar" comment="Town"/>
</table>
<table name="sales_order_address">
<column name="city_code" nullable="true" xsi:type="int" comment="City"/>
<column name="district_code" nullable="true" xsi:type="int" comment="District"/>
<column name="district" nullable="true" xsi:type="varchar" comment="District"/>
<column name="town_code" nullable="true" xsi:type="int" comment="Town"/>
<column name="town" nullable="true" xsi:type="varchar" comment="Town"/>
</table>
<table name="quote_address">
<column name="city_code" nullable="true" xsi:type="int" comment="City"/>
<column name="district_code" nullable="true" xsi:type="int" comment="District"/>
<column name="district" nullable="true" xsi:type="varchar" comment="District"/>
<column name="town_code" nullable="true" xsi:type="int" comment="Town"/>
<column name="town" nullable="true" xsi:type="varchar" comment="Town"/>
</table>
<table name="directory_country_city" engine="innodb" comment="Directory Country City">
<column name="code" nullable="false" xsi:type="int" unsigned="true" identity="false" comment="City Code"/>
<column name="parent_code" nullable="false" xsi:type="int" unsigned="true" comment="Directory Country Region Code"/>
<column name="name" nullable="false" xsi:type="varchar" comment="District"/>
<index referenceId="directory_country_city_parent_code" indexType="btree">
<column name="parent_code"/>
</index>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="code" />
</constraint>
<constraint xsi:type="unique" referenceId="directory_country_city_unique_code">
<column name="code"/>
</constraint>
</table>
<table name="directory_country_district" engine="innodb" comment="Directory Country District">
<column name="code" nullable="false" xsi:type="int" unsigned="true" identity="false" comment="District Code"/>
<column name="parent_code" nullable="false" xsi:type="int" unsigned="true" comment="Directory Country City Code"/>
<column name="name" nullable="false" xsi:type="varchar" comment="District"/>
<index referenceId="directory_country_city_parent_code" indexType="btree">
<column name="parent_code"/>
</index>
<constraint xsi:type="foreign" referenceId="directory_country_district_code"
table="directory_country_district" column="parent_code" referenceTable="directory_country_city"
referenceColumn="code" onDelete="CASCADE"/>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="code" />
</constraint>
<constraint xsi:type="unique" referenceId="directory_country_district_unique_code">
<column name="code"/>
</constraint>
</table>
<table name="directory_country_town" engine="innodb" comment="Directory Country Town">
<column name="code" nullable="false" xsi:type="int" unsigned="true" identity="false" comment="Town Code"/>
<column name="parent_code" nullable="false" xsi:type="int" unsigned="true" comment="Directory Country Town Code"/>
<column name="name" nullable="false" xsi:type="varchar" comment="District"/>
<index referenceId="directory_country_town_parent_code" indexType="btree">
<column name="parent_code"/>
</index>
<constraint xsi:type="foreign" referenceId="directory_country_city_code"
table="directory_country_town" column="parent_code" referenceTable="directory_country_district"
referenceColumn="code" onDelete="CASCADE"/>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="code" />
</constraint>
<constraint xsi:type="unique" referenceId="directory_country_town_unique_code">
<column name="code"/>
</constraint>
</table>
</schema>
@@ -0,0 +1,6 @@
<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\Quote\Model\Quote">
<plugin name="set_extension_attribute_data_to_shipping_address" type="Stemcell\ChineseDirectory\Plugin\ShippingAddress\ExtensionAttribute" />
</type>
</config>
@@ -0,0 +1,6 @@
<?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="sales_model_service_quote_submit_before">
<observer name="attach_extension_attribute" instance="Stemcell\ChineseDirectory\Observer\Order\Address\AttachExtensionAttributeObserver" />
</event>
</config>
@@ -0,0 +1,24 @@
<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd">
<extension_attributes for="Magento\Customer\Api\Data\AddressInterface">
<attribute code="city_code" type="int"/>
<attribute code="district_code" type="int"/>
<attribute code="district" type="string"/>
<attribute code="town_code" type="int"/>
<attribute code="town" type="string"/>
</extension_attributes>
<extension_attributes for="Magento\Quote\Api\Data\AddressInterface">
<attribute code="city_code" type="int"/>
<attribute code="district_code" type="int"/>
<attribute code="district" type="string"/>
<attribute code="town_code" type="int"/>
<attribute code="town" type="string"/>
</extension_attributes>
<extension_attributes for="Magento\Sales\Api\Data\OrderAddressInterface">
<attribute code="city_code" type="int"/>
<attribute code="district_code" type="int"/>
<attribute code="district" type="string"/>
<attribute code="town_code" type="int"/>
<attribute code="town" type="string"/>
</extension_attributes>
</config>
@@ -0,0 +1,76 @@
<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:DataObject/etc/fieldset.xsd">
<scope id="global">
<fieldset id="extra_checkout_shipping_address_fields">
<field name="city_code">
<aspect name="to_order_address"/>
<aspect name="to_quote_address"/>
<aspect name="to_customer_address"/>
</field>
<field name="district_code">
<aspect name="to_order_address"/>
<aspect name="to_quote_address"/>
<aspect name="to_customer_address"/>
</field>
<field name="district">
<aspect name="to_order_address"/>
<aspect name="to_quote_address"/>
<aspect name="to_customer_address"/>
</field>
<field name="town_code">
<aspect name="to_order_address"/>
<aspect name="to_quote_address"/>
<aspect name="to_customer_address"/>
</field>
<field name="town">
<aspect name="to_order_address"/>
<aspect name="to_quote_address"/>
<aspect name="to_customer_address"/>
</field>
</fieldset>
<fieldset id="extra_checkout_billing_address_fields">
<field name="city_code">
<aspect name="to_order_address"/>
<aspect name="to_customer_address"/>
</field>
<field name="district_code">
<aspect name="to_order_address"/>
<aspect name="to_customer_address"/>
</field>
<field name="district">
<aspect name="to_order_address"/>
<aspect name="to_customer_address"/>
</field>
<field name="town_code">
<aspect name="to_order_address"/>
<aspect name="to_customer_address"/>
</field>
<field name="town">
<aspect name="to_order_address"/>
<aspect name="to_customer_address"/>
</field>
</fieldset>
<fieldset id="sales_convert_quote_address">
<field name="city_code">
<aspect name="to_order_address"/>
<aspect name="to_customer_address"/>
</field>
<field name="district_code">
<aspect name="to_order_address"/>
<aspect name="to_customer_address"/>
</field>
<field name="district">
<aspect name="to_order_address"/>
<aspect name="to_customer_address"/>
</field>
<field name="town_code">
<aspect name="to_order_address"/>
<aspect name="to_customer_address"/>
</field>
<field name="town">
<aspect name="to_order_address"/>
<aspect name="to_customer_address"/>
</field>
</fieldset>
</scope>
</config>
@@ -0,0 +1,14 @@
<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
<router id="standard">
<route id="stemcell_chinesedirectory" frontName="stemcell_chinesedirectory">
<module name="Stemcell_ChineseDirectory" />
</route>
</router>
</config>
@@ -0,0 +1,9 @@
<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Stemcell_ChineseDirectory">
<sequence>
<module name="Magento_Customer"/>
<module name="Magento_Directory"/>
</sequence>
</module>
</config>