init
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
|
||||
<table name="quote">
|
||||
<column xsi:type="int" name="salesperson_id" unsigned="true" nullable="true" identity="false"
|
||||
default="0" comment="Salesperson ID"/>
|
||||
<column xsi:type="decimal" name="customer_discount" unsigned="false" nullable="true"
|
||||
default="0" scale="2" comment="customer discount"/>
|
||||
</table>
|
||||
|
||||
<table name="quote_item" resource="checkout" engine="innodb" comment="Sales Flat Quote Item">
|
||||
<column xsi:type="int" name="lab_id" unsigned="true" nullable="false" comment="Lab Code"/>
|
||||
<column xsi:type="varchar" name="lab_code" nullable="false" length="255" comment="Lab Code"/>
|
||||
<column xsi:type="varchar" name="pi_sap_id" nullable="false" length="255" comment="Lab PI SAP ID"/>
|
||||
<column xsi:type="int" name="salesperson_id" unsigned="true" nullable="true" identity="false"
|
||||
default="0" comment="Salesperson ID"/>
|
||||
<column xsi:type="varchar" name="cd" nullable="false" length="255" comment="CD"/>
|
||||
<column xsi:type="varchar" name="quote" nullable="false" length="255" comment="Quote"/>
|
||||
<column xsi:type="decimal" name="customer_discount_percent" scale="4" precision="12" unsigned="true"
|
||||
nullable="false" default="0" comment="用户在购物车中填写的折扣"/>
|
||||
<column xsi:type="varchar" name="pi" nullable="false" length="255" comment="PI"/>
|
||||
<column xsi:type="varchar" name="company" nullable="false" length="255" comment="最终用户单位"/>
|
||||
<column xsi:type="varchar" name="user" nullable="false" length="255" comment="最终使用人"/>
|
||||
<column xsi:type="varchar" name="user_tel" nullable="false" length="255" comment="最终使用人电话"/>
|
||||
<column xsi:type="varchar" name="user_email" nullable="false" length="255" comment="最终使用人邮箱"/>
|
||||
<column xsi:type="varchar" name="note" nullable="false" length="255" comment="备注"/>
|
||||
<column xsi:type="smallint" name="user_type" nullable="false" comment="终端类型: 终端、二级经销商"/>
|
||||
<column xsi:type="int" name="item_sort" unsigned="true" nullable="true" identity="false"
|
||||
default="0" comment="Item Sort"/>
|
||||
</table>
|
||||
|
||||
<table name="sales_order">
|
||||
<column xsi:type="int" name="salesperson_id" unsigned="true" nullable="true" identity="false"
|
||||
default="0" comment="Salesperson ID"/>
|
||||
<column xsi:type="decimal" name="customer_discount" unsigned="false" nullable="true" scale="2"
|
||||
default="0" comment="customer discount"/>
|
||||
</table>
|
||||
|
||||
<table name="sales_order_item" resource="checkout" engine="innodb" comment="Sales Flat Quote Item">
|
||||
<column xsi:type="int" name="lab_id" unsigned="true" nullable="false" comment="Lab Code"/>
|
||||
<column xsi:type="varchar" name="lab_code" nullable="false" length="255" comment="Lab Code"/>
|
||||
<column xsi:type="varchar" name="pi_sap_id" nullable="false" length="255" comment="Lab PI SAP ID"/>
|
||||
<column xsi:type="int" name="salesperson_id" unsigned="true" nullable="true" identity="false"
|
||||
default="0" comment="Salesperson ID"/>
|
||||
<column xsi:type="varchar" name="cd" nullable="false" length="255" comment="CD"/>
|
||||
<column xsi:type="varchar" name="quote" nullable="false" length="255" comment="Quote"/>
|
||||
<column xsi:type="decimal" name="customer_discount_percent" scale="4" precision="12" unsigned="true"
|
||||
nullable="false" default="0" comment="用户在购物车中填写的折扣"/>
|
||||
<column xsi:type="varchar" name="pi" nullable="false" length="255" comment="PI"/>
|
||||
<column xsi:type="varchar" name="company" nullable="false" length="255" comment="最终用户单位"/>
|
||||
<column xsi:type="varchar" name="user" nullable="false" length="255" comment="最终使用人"/>
|
||||
<column xsi:type="varchar" name="user_tel" nullable="false" length="255" comment="最终使用人电话"/>
|
||||
<column xsi:type="varchar" name="user_email" nullable="false" length="255" comment="最终使用人邮箱"/>
|
||||
<column xsi:type="varchar" name="note" nullable="false" length="255" comment="备注"/>
|
||||
<column xsi:type="smallint" name="user_type" nullable="false" comment="终端类型: 终端、二级经销商"/>
|
||||
<column xsi:type="int" name="item_sort" unsigned="true" nullable="true" identity="false"
|
||||
default="0" comment="Item Sort"/>
|
||||
</table>
|
||||
</schema>
|
||||
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" ?>
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
|
||||
<preference for="Magento\Checkout\Block\Cart\Item\Renderer" type="Stemcell\Checkout\Block\Cart\Item\Renderer" />
|
||||
<preference for="\Magento\Checkout\Model\Cart" type="Stemcell\Checkout\Model\Cart" />
|
||||
<preference for="\Magento\Bundle\Helper\Catalog\Product\Configuration" type="Stemcell\Checkout\Helper\Catalog\Product\Configuration" />
|
||||
|
||||
<preference for="Stemcell\Checkout\Api\Data\Quote\TotalsItemInterface" type="Stemcell\Checkout\Model\Cart\Totals\Item" />
|
||||
<preference for="Stemcell\Checkout\Api\Data\Quote\TotalsInterface" type="Stemcell\Checkout\Model\Cart\Totals" />
|
||||
|
||||
<preference for="Stemcell\Checkout\Api\CartTotalRepositoryInterface" type="Stemcell\Checkout\Model\Cart\CartTotalRepository" />
|
||||
|
||||
<type name="Magento\Quote\Model\Cart\CartTotalRepository">
|
||||
<arguments>
|
||||
<argument name="converter" xsi:type="object">Stemcell\Checkout\Model\Cart\Totals\ItemConverter</argument>
|
||||
</arguments>
|
||||
</type>
|
||||
|
||||
<type name="Stemcell\Checkout\Model\Cart\CartTotalRepository">
|
||||
<arguments>
|
||||
<argument name="converter" xsi:type="object">Stemcell\Checkout\Model\Cart\Totals\ItemConverter</argument>
|
||||
</arguments>
|
||||
</type>
|
||||
|
||||
</config>
|
||||
@@ -0,0 +1,8 @@
|
||||
<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="stemcell_checkout_sales_model_service_quote_submit_before" instance="Stemcell\Checkout\Observer\FieldCopy" />
|
||||
</event>
|
||||
<event name="checkout_cart_save_before">
|
||||
<observer name="customer_discount_persistent" instance="Stemcell\Checkout\Observer\ApplyCustomerDiscount" />
|
||||
</event>
|
||||
</config>
|
||||
@@ -0,0 +1,48 @@
|
||||
<?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:Api/etc/extension_attributes.xsd">
|
||||
<extension_attributes for="Magento\Quote\Api\Data\CartInterface">
|
||||
<attribute code="salesperson_id" type="int" />
|
||||
<attribute code="customer_discount" type="float" />
|
||||
</extension_attributes>
|
||||
|
||||
<extension_attributes for="Magento\Quote\Api\Data\CartItemInterface">
|
||||
<attribute code="lab_id" type="int" />
|
||||
<attribute code="lab_code" type="string" />
|
||||
<attribute code="pi_sap_id" type="string" />
|
||||
<attribute code="cd" type="string" />
|
||||
<attribute code="quote" type="string" />
|
||||
<attribute code="pi" type="string" />
|
||||
<attribute code="company" type="string" />
|
||||
<attribute code="user" type="string" />
|
||||
<attribute code="user_tel" type="string" />
|
||||
<attribute code="user_email" type="string" />
|
||||
<attribute code="note" type="string" />
|
||||
<attribute code="user_type" type="int" />
|
||||
</extension_attributes>
|
||||
|
||||
<extension_attributes for="Magento\Sales\Api\Data\OrderInterface">
|
||||
<attribute code="salesperson_id" type="int" />
|
||||
<attribute code="customer_discount" type="float" />
|
||||
</extension_attributes>
|
||||
|
||||
<extension_attributes for="Magento\Sales\Api\Data\OrderItemInterface">
|
||||
<attribute code="lab_id" type="int" />
|
||||
<attribute code="lab_code" type="string" />
|
||||
<attribute code="pi_sap_id" type="string" />
|
||||
<attribute code="cd" type="string" />
|
||||
<attribute code="quote" type="string" />
|
||||
<attribute code="pi" type="string" />
|
||||
<attribute code="company" type="string" />
|
||||
<attribute code="user" type="string" />
|
||||
<attribute code="user_tel" type="string" />
|
||||
<attribute code="user_email" type="string" />
|
||||
<attribute code="note" type="string" />
|
||||
<attribute code="user_type" type="int" />
|
||||
</extension_attributes>
|
||||
</config>
|
||||
@@ -0,0 +1,55 @@
|
||||
<?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:DataObject/etc/fieldset.xsd">
|
||||
<scope id="global">
|
||||
<fieldset id="sales_convert_quote">
|
||||
<field name="salesperson_id">
|
||||
<aspect name="to_order" />
|
||||
</field>
|
||||
</fieldset>
|
||||
<fieldset id="quote_convert_item">
|
||||
<field name="lab_id">
|
||||
<aspect name="to_order_item" />
|
||||
</field>
|
||||
<field name="lab_code">
|
||||
<aspect name="to_order_item" />
|
||||
</field>
|
||||
<field name="pi_sap_id">
|
||||
<aspect name="to_order_item" />
|
||||
</field>
|
||||
<field name="cd">
|
||||
<aspect name="to_order_item" />
|
||||
</field>
|
||||
<field name="quote">
|
||||
<aspect name="to_order_item" />
|
||||
</field>
|
||||
<field name="pi">
|
||||
<aspect name="to_order_item" />
|
||||
</field>
|
||||
<field name="company">
|
||||
<aspect name="to_order_item" />
|
||||
</field>
|
||||
<field name="user">
|
||||
<aspect name="to_order_item" />
|
||||
</field>
|
||||
<field name="user_tel">
|
||||
<aspect name="to_order_item" />
|
||||
</field>
|
||||
<field name="user_email">
|
||||
<aspect name="to_order_item" />
|
||||
</field>
|
||||
<field name="note">
|
||||
<aspect name="to_order_item" />
|
||||
</field>
|
||||
<field name="user_type">
|
||||
<aspect name="to_order_item" />
|
||||
</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_checkout" frontName="stemcell_checkout">
|
||||
<module name="Stemcell_Checkout" />
|
||||
</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_Checkout">
|
||||
<sequence>
|
||||
<module name="Magento_Checkout"/>
|
||||
<module name="Magento_Quote"/>
|
||||
</sequence>
|
||||
</module>
|
||||
</config>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd">
|
||||
|
||||
<!-- Managing My Cart Total -->
|
||||
<route url="/V1/carts/mine/totals" method="GET">
|
||||
<service class="Stemcell\Checkout\Api\CartTotalRepositoryInterface" method="get"/>
|
||||
<resources>
|
||||
<resource ref="self" />
|
||||
</resources>
|
||||
<data>
|
||||
<parameter name="cartId" force="true">%cart_id%</parameter>
|
||||
</data>
|
||||
</route>
|
||||
|
||||
</routes>
|
||||
Reference in New Issue
Block a user