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_Cart::config"
title="Esun Cart Configuration"
sortOrder="93"/>
</resource>
</resource>
</resource>
</resource>
</resources>
</acl>
</config>
@@ -0,0 +1,60 @@
<?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_cart" translate="label" type="text" sortOrder="930"
showInDefault="1" showInWebsite="1" showInStore="0">
<label>Cart</label>
<tab>esun</tab>
<resource>Esun_Cart::config</resource>
<group id="test_mode" translate="label" type="text" sortOrder="10"
showInDefault="1" showInWebsite="1" showInStore="0">
<label>Purchase Test Mode</label>
<field id="enabled" translate="label comment" type="select" sortOrder="10"
showInDefault="1" showInWebsite="1" showInStore="0">
<label>Enable Test Mode</label>
<comment>When enabled, only the selected customer groups can add products to the cart.</comment>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>
<field id="allowed_customer_groups" translate="label comment" type="multiselect" sortOrder="20"
showInDefault="1" showInWebsite="1" showInStore="0">
<label>Allowed Customer Groups</label>
<comment>Customers in these groups can use the complete purchase test flow. Leave empty to block all customers.</comment>
<source_model>Magento\Customer\Model\Config\Source\Group\Multiselect</source_model>
<depends>
<field id="enabled">1</field>
</depends>
</field>
<field id="popup_title" translate="label comment" type="text" sortOrder="30"
showInDefault="1" showInWebsite="1" showInStore="0">
<label>Popup Title</label>
<comment>Leave empty to use: Test Mode</comment>
<depends>
<field id="enabled">1</field>
</depends>
</field>
<field id="popup_message" translate="label comment" type="textarea" sortOrder="40"
showInDefault="1" showInWebsite="1" showInStore="0">
<label>Popup Message</label>
<comment>Leave empty to use the default beta testing notice.</comment>
<depends>
<field id="enabled">1</field>
</depends>
</field>
</group>
<group id="recommendations" translate="label" type="text" sortOrder="20"
showInDefault="1" showInWebsite="1" showInStore="0">
<label>Cart Recommendations</label>
<field id="product_skus" translate="label comment" type="textarea" sortOrder="10"
showInDefault="1" showInWebsite="1" showInStore="0">
<label>Recommended Product SKUs</label>
<backend_model>Esun\Cart\Model\Config\Backend\RecommendedProductSkus</backend_model>
<comment>Enter one SKU per line. The order is the display order. Website scope inherits the default list unless Use Default is disabled.</comment>
</field>
</group>
</section>
</system>
</config>
+22
View File
@@ -0,0 +1,22 @@
<?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>
<esun_cart>
<recommendations>
<product_skus></product_skus>
</recommendations>
<test_mode>
<enabled>0</enabled>
<allowed_customer_groups></allowed_customer_groups>
<popup_title>Test Mode</popup_title>
<popup_message>Our website is currently in beta testing. Purchases are not available at this time.</popup_message>
</test_mode>
</esun_cart>
<checkout>
<cart>
<configurable_product_image>itself</configurable_product_image>
</cart>
</checkout>
</default>
</config>
+12
View File
@@ -0,0 +1,12 @@
<?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="quote_item" resource="checkout" engine="innodb" comment="Sales Flat Quote Item">
<column xsi:type="smallint"
name="esun_mix_price_applied"
unsigned="true"
nullable="false"
default="0"
comment="eSUN Mix Step Price Applied"/>
</table>
</schema>
+8
View File
@@ -0,0 +1,8 @@
<?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\OfflineShipping\Model\Carrier\Flatrate">
<plugin name="esun_cart_quantity_free_shipping"
type="Esun\Cart\Plugin\Shipping\FlatratePlugin"/>
</type>
</config>
+8
View File
@@ -0,0 +1,8 @@
<?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_quote_collect_totals_before">
<observer name="esun_apply_parent_mix_step_prices"
instance="Esun\Cart\Observer\ApplyMixStepPrices"/>
</event>
</config>
+42
View File
@@ -0,0 +1,42 @@
<?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\Checkout\Model\Cart">
<plugin name="esun_cart_test_mode_restriction"
type="Esun\Cart\Plugin\TestMode\RestrictAddToCartPlugin"
sortOrder="10"/>
</type>
<type name="Magento\Checkout\Controller\Index\Index">
<plugin name="esun_cart_test_mode_checkout_restriction"
type="Esun\Cart\Plugin\TestMode\RestrictCheckoutPlugin"
sortOrder="10"/>
</type>
<type name="Magento\Checkout\CustomerData\Cart">
<plugin name="esun_cart_drawer_customer_data"
type="Esun\Cart\Plugin\CustomerData\CartPlugin"/>
</type>
<type name="Magento\Checkout\Model\CompositeConfigProvider">
<arguments>
<argument name="configProviders" xsi:type="array">
<item name="esun_cart_checkout_services" xsi:type="object">Esun\Cart\Model\Checkout\ServicesConfigProvider</item>
</argument>
</arguments>
</type>
<type name="Amasty\CheckoutCore\Block\Onepage\LayoutProcessor">
<plugin name="esun_cart_checkout_services_layout"
type="Esun\Cart\Plugin\Checkout\SummaryLayoutProcessorPlugin"
sortOrder="210"/>
</type>
<type name="Magento\Framework\View\Element\Message\MessageConfigurationsPool">
<arguments>
<argument name="configurationsMap" xsi:type="array">
<item name="addCartSuccessMessage" xsi:type="array">
<item name="renderer" xsi:type="const">\Magento\Framework\View\Element\Message\Renderer\BlockRenderer::CODE</item>
<item name="data" xsi:type="array">
<item name="template" xsi:type="string">Esun_Cart::messages/addCartSuccessMessage.phtml</item>
</item>
</item>
</argument>
</arguments>
</type>
</config>
@@ -0,0 +1,9 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
<router id="standard">
<route id="esun_cart" frontName="esun_cart">
<module name="Esun_Cart"/>
</route>
</router>
</config>
@@ -0,0 +1,11 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/sections.xsd">
<action name="esun_cart/mix/add">
<section name="cart"/>
<section name="messages"/>
</action>
<action name="esun_cart/coupon/save">
<section name="cart"/>
</action>
</config>
+16
View File
@@ -0,0 +1,16 @@
<?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_Cart">
<sequence>
<module name="Magento_Checkout"/>
<module name="Magento_ConfigurableProduct"/>
<module name="Magento_Cms"/>
<module name="Magento_Customer"/>
<module name="Magento_OfflineShipping"/>
<module name="Magento_SalesRule"/>
<module name="Amasty_CheckoutCore"/>
<module name="Esun_Catalog"/>
</sequence>
</module>
</config>