2017-05-26 64 views
1

我需要在結帳頁面顯示訂單彙總,例如,在默認Magento 2設置中添加購物車中的產品後,Magento 2結賬頁面訂單摘要添加結帳/索引/索引

  1. 本地主機/ magento216 /結算/
  2. 本地主機/ magento216 /結算/#支付

可以檢查在第一URL訂單彙總不包含訂單總計塊。請查看屏幕截圖以獲取幫助。

我想要的是訂單總額中添加本地主機/ magento216 /結算/同樣的工作在localhost/magento216 /結算/#支付

先謝謝了!

Checkout

Checkout#payment

回答

1

終於實現它...

轉到文件路徑 - \供應商\ Magento的\主題前端,亮度\ Magento_Checkout \佈局\ 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> 

快樂編碼! :)

+0

在我的自定義主題中,我已將此內容添加到此文件「Magento_Checkout \ layout \ checkout_index_index.xml」,但它不起作用。 – Sarfaraj

+0

我使用的是自定義主題,並編輯了塊,並開始顯示總計。謝謝 –

+1

歡迎你,很高興收到你的來信@AthulVijayan –