Magento2添加购物车总额块到结帐运输部分

时间:2017-05-26 23:53:30

标签: checkout magento2 sidebar totals

尝试将购物车页面边栏中的总计块复制到订单汇总块下的结帐送货部分侧边栏。

我遇到了与块xml中参数>项的唯一命名有关的错误。什么是复制/显示我希望的总计块的最佳方式?

有问题的块xml位于Magento_Checkout checkout_cart_index.xml文件中

                       <container name="checkout.cart.totals.container" as="totals" label="Shopping Cart Totals">
                            <block class="Magento\Checkout\Block\Cart\Totals" name="checkout.cart.totals" template="cart/totals.phtml">
                                <arguments>
                                    <argument name="jsLayout" xsi:type="array">
                                        <item name="components" xsi:type="array">
                                            <item name="block-totals" xsi:type="array">
                                                <item name="component" xsi:type="string">Magento_Checkout/js/view/cart/totals</item>
                                                <item name="displayArea" xsi:type="string">totals</item>
                                                <item name="config" xsi:type="array">
                                                    <item name="template" xsi:type="string">Magento_Checkout/cart/totals</item>
                                                </item>
                                                <item name="children" xsi:type="array">
                                                    <!-- sort order for this totals is configured on admin panel-->
                                                    <!-- Stores->Configuration->SALES->Sales->General->Checkout Totals Sort Order -->
                                                    <item name="subtotal" xsi:type="array">
                                                        <item name="component"  xsi:type="string">Magento_Checkout/js/view/summary/subtotal</item>
                                                        <item name="config" xsi:type="array">
                                                            <item name="title" xsi:type="string" translate="true">Subtotal</item>
                                                            <item name="template" xsi:type="string">Magento_Checkout/cart/totals/subtotal</item>
                                                        </item>
                                                    </item>
                                                    <item name="shipping" xsi:type="array">
                                                        <item name="component"  xsi:type="string">Magento_Checkout/js/view/cart/totals/shipping</item>
                                                        <item name="config" xsi:type="array">
                                                            <item name="title" xsi:type="string" translate="true">Shipping</item>
                                                            <item name="template" xsi:type="string">Magento_Checkout/cart/totals/shipping</item>
                                                        </item>
                                                    </item>
                                                    <item name="grand-total" xsi:type="array">
                                                        <item name="component"  xsi:type="string">Magento_Checkout/js/view/summary/grand-total</item>
                                                        <item name="config" xsi:type="array">
                                                            <item name="title" xsi:type="string" translate="true">Order Total</item>
                                                            <item name="template" xsi:type="string">Magento_Checkout/cart/totals/grand-total</item>
                                                        </item>
                                                    </item>
                                                </item>
                                            </item>
                                        </item>
                                    </argument>
                                </arguments>
                            </block>
                        </container>

0 个答案:

没有答案