当前位置: 首页 > 知识库问答 >
问题:

Magento 2签出页面订单汇总在签出/索引/索引时添加

左劲
2023-03-14

我需要在两个结账页面中显示订单摘要,即当您在Magento2默认设置中在购物车中添加产品后将转到以下URL时:

  1. localhost/magento216/签出/
  2. localhost/magento216/结账/#付款

您可以检查第一个URL中的订单摘要不包含order totals块。请查看截图寻求帮助。

我想要的是在localhost/magento216/checkout/类似地工作在localhost/magento216/checkout/#payment中添加订单总数

提前致谢!!!

结帐

结账#付款

共有1个答案

严欣怡
2023-03-14

终于实现了……

转到文件路径-\vendor\magento\theme-frontend-luma\magento_checkout\layout\checkout_index_index.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
    <referenceBlock name="checkout.root">
        <arguments>
            <argument name="jsLayout" xsi:type="array">
                <item name="components" xsi:type="array">
                    <item name="checkout" xsi:type="array">
                        <item name="children" xsi:type="array">
                            <item name="steps" xsi:type="array">
                                <item name="children" xsi:type="array">
                                    <item name="shipping-step" xsi:type="array">
                                        <item name="children" xsi:type="array">
                                            <item name="shippingAddress" xsi:type="array">
                                                <item name="children" xsi:type="array">
                                                    <item name="before-shipping-method-form" xsi:type="array">
                                                        <item name="children" xsi:type="array">
                                                            <item name="shipping_policy" xsi:type="array">
                                                                <item name="component" xsi:type="string">Magento_Shipping/js/view/checkout/shipping/shipping-policy</item>
                                                                <item name="component" xsi:type="string">Magento_Checkout/js/view/cart/shipping-rates</item>
                                                                <item name="component" xsi:type="string">Magento_Checkout/js/view/cart/shipping-estimation</item>
                                                            </item>
                                                        </item>
                                                    </item>
                                                </item>
                                            </item>
                                        </item>
                                    </item>
                                </item>
                            </item>

                            <item name="sidebar" xsi:type="array">
                                <item name="children" xsi:type="array">
                                    <item name="summary" xsi:type="array">
                                        <item name="children" 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>
                                    </item>
                                </item>
                            </item>
                        </item>
                    </item>
                </item>
            </argument>
        </arguments>
    </referenceBlock>
</body>

null

快乐编码!!!:)

 类似资料:
  • 问题内容: 我得到以下代码的异常。但是不明白为什么。 我可以使它起作用,但是我试图理解这些概念,因此我将声明更改为以下内容,但也没有起作用。 问题答案: ArrayList索引从0开始(零) 您的数组列表大小为0,并且要在第一个索引处添加String元素。如果不在第0个索引处添加元素,则无法添加下一个索引位置。错了 因此,只需使其成为 或者你可以

  • 这是Lucene In Action Book中给出的一个程序。它只索引父文件夹中的文件而不是子文件夹中的文件。因此,我添加了一个if块以递归地查找子文件夹中的文件。但运行此程序后,它正在创建write.lock文件,即使在关闭命令提示符后,它仍继续创建索引文件。代码有什么问题? 我是和的新手,之前我尝试使用apache Commons io查找子文件夹,但我正在获取包不存在错误(包org.apa

  • 我正在使用chartjs绘制雷达图。 该值显示在图表的悬停点上,但我希望始终显示该值。我需要更改视图以在打印页面时显示数据。 这是我目前的图表。悬停时显示标签

  • 错误 ()1中的索引器错误回溯(最近一次调用)---- ~/Documents/PhD/IntelliSys19/journal/ColdStart_实验/相似性_函数。用户中u2的装饰矩阵中的py()145:146评级1=np。nan_to_num(np.array(user_ratings_matrix.iloc[u1-1].values))-- ~/anaconda3/lib/python3

  • 在WooCommerce结账页面上,我添加了一个客户必须输入才能结账的额外字段。 我想在woocommerce\u cart\u calculate\u fees操作挂钩中访问此字段的值。 通过使用woocommerce,我尝试了几种方法-

  • 当我跑的时候 我得到以下错误: 我试着改变我的ElasticSearch的版本。我的当前版本是: $curl-xget'localhost:9200'{“name”:“mokbeeq”,“cluster_name”:“elasticsearch”,“cluster_uuid”:“pf_z62bbtl-jq31hsuahqa”,“version”:{“number”:“5.6.8”,“build_h