This commit is contained in:
2026-09-15 10:35:56 +08:00
commit 782f8ea7aa
4086 changed files with 631288 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd">
<acl>
<resources>
<resource id="Magento_Backend::admin">
<resource id="Magento_Backend::stores">
<resource id="Magento_Backend::stores_settings">
<resource id="Magento_Config::config">
<resource id="Esun_OrderNumber::configuration"
title="Order Number Configuration"
sortOrder="98"/>
</resource>
</resource>
</resource>
</resource>
</resources>
</acl>
</config>
@@ -0,0 +1,34 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
<system>
<tab id="esun" translate="label" sortOrder="300">
<label>Esun</label>
</tab>
<section id="esun_order_number" translate="label" type="text" sortOrder="380"
showInDefault="1" showInWebsite="1" showInStore="0">
<label>Order Number</label>
<tab>esun</tab>
<resource>Esun_OrderNumber::configuration</resource>
<group id="general" translate="label comment" type="text" sortOrder="10"
showInDefault="1" showInWebsite="1" showInStore="0">
<label>Website Order Number</label>
<comment>Configure this separately for each Website.</comment>
<field id="site_name" translate="label comment" type="text" sortOrder="10"
showInDefault="1" showInWebsite="1" showInStore="0">
<label>Site Name</label>
<comment>Order numbers use Site Name + Number, for example US100001. If empty, the Website code is used.</comment>
<validate>validate-length maximum-length-24</validate>
<config_path>sales/order_number/site_name</config_path>
</field>
<field id="start_number" translate="label comment" type="text" sortOrder="20"
showInDefault="1" showInWebsite="1" showInStore="0">
<label>First Order Number</label>
<comment>Used only when this Website generates its first custom order number. Later changes do not reset an active sequence.</comment>
<validate>required-entry validate-digits validate-greater-than-zero</validate>
<config_path>sales/order_number/start_number</config_path>
</field>
</group>
</section>
</system>
</config>
+11
View File
@@ -0,0 +1,11 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
<default>
<sales>
<order_number>
<start_number>1</start_number>
</order_number>
</sales>
</default>
</config>
@@ -0,0 +1,14 @@
<?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="esun_order_number_sequence" resource="sales" engine="innodb"
comment="Esun Website Order Number Sequence">
<column xsi:type="smallint" name="website_id" unsigned="true" nullable="false"
comment="Website ID"/>
<column xsi:type="bigint" name="last_value" unsigned="true" nullable="false"
default="0" comment="Last Reserved Order Number"/>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="website_id"/>
</constraint>
</table>
</schema>
@@ -0,0 +1,11 @@
{
"esun_order_number_sequence": {
"column": {
"website_id": true,
"last_value": true
},
"constraint": {
"PRIMARY": true
}
}
}
+9
View File
@@ -0,0 +1,9 @@
<?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\SalesSequence\Model\Manager">
<plugin name="esun_website_order_number_sequence"
type="Esun\OrderNumber\Plugin\SalesSequenceManagerPlugin"
sortOrder="10"/>
</type>
</config>
+13
View File
@@ -0,0 +1,13 @@
<?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="Esun_OrderNumber">
<sequence>
<module name="Magento_Config"/>
<module name="Magento_Quote"/>
<module name="Magento_Sales"/>
<module name="Magento_SalesSequence"/>
<module name="Magento_Store"/>
</sequence>
</module>
</config>