2012-08-08 66 views
2

Magento的結帳中有一行顯示文件的總數:我如何採取總量幀的運輸方式輸出在Magento

前端/基/默認/模板/結算/ onepage /審查/ info.phtml

<?php echo $this->getChildHtml('totals'); ?> 

但此行也顯示了送貨方式,如果客戶選擇的貨運方式和我沒有 發現這把它我總頁數的,我知道,我不能因爲從數據庫中刪除這些信息用於貨運選擇。

如果有人知道我會留很欣慰

由於現在

回答

3

爲了從你需要重寫以下類別的總刪除此數據:

爲了把它藏在購物車頁面:

Mage_Sales_Model_Quote_Address_Total_Shipping ::取()方法需要經由定製模塊被重寫:

public function fetch(Mage_Sales_Model_Quote_Address $address) 
{ 
    $originalShippingDescription = $address->getShippingDescription(); // Keep old description value 
    $address->unsShippingDescription(); // Removes description of shipping method 
    parent::fetch($address); 
    $address->setShippingDescription($originalShippingDescription); // Sets back original description of shipping method 
    return $this; 
} 

來隱藏它在用戶帳戶才能概覽頁面,您需要執行的Mage_Sales_Block_Order_Totals類其他自定義。爲此,你需要創建一個新的塊從擴展Mage_Core_Block_Abstract

  1. 在一些自定義模塊

    <?php 
    class Custom_Module_Block_Shipping_Total extents Mage_Core_Block_Abstract 
    { 
        public function initTotals() 
        { 
         if ($this->getParentBlock() && $this->getParentBlock()->getTotal('shipping')) { 
          $this->getParentBlock()->getTotal('shipping')->setLabel($this->__('Shipping & Handling')); 
         } 
        } 
    } 
    
  2. 創建塊添加布局更新,包括您阻止進入訂單視圖。

    <layout> 
    <!-- Your custom total on invoices view --> 
        <custom_invoice_totals> 
         <reference name="invoice_totals"> 
          <block name="custom_total" type="custom_module/shipping_total" /> 
         </reference> 
        </custom_invoice_totals> 
    
        <!-- Your custom total on shipments view --> 
        <custom_shipment_totals> 
         <reference name="shipment_totals"> 
          <block name="custom_total" type="custom_module/shipping_total" /> 
         </reference> 
        </custom_shipment_totals> 
    
        <!-- Your custom total on creditmemos view --> 
        <custom_creditmemo_totals> 
         <reference name="creditmemo_items"> 
          <block name="custom_total" type="custom_module/shipping_total" /> 
         </reference> 
        </custom_creditmemo_totals> 
    
    
        <!-- Applying your handles to particular pages in customer account --> 
        <sales_order_view> 
         <update handle="custom_order_totals" /> 
        </sales_order_view> 
    
        <sales_order_print> 
         <update handle="custom_order_totals" /> 
        </sales_order_print> 
    
        <sales_email_order_items> 
         <update handle="custom_order_totals" /> 
        </sales_email_order_items> 
    
        <!-- applies your total in email --> 
        <sales_email_order_items> 
         <update handle="custom_order_totals" /> 
        </sales_email_order_items> 
    
        <sales_guest_view> 
         <update handle="custom_order_totals" /> 
        </sales_guest_view> 
    
        <!-- invoice pages --> 
        <sales_order_invoice> 
         <update handle="custom_invoice_totals" /> 
        </sales_order_invoice> 
    
        <sales_order_printinvoice> 
         <update handle="custom_invoice_totals" /> 
        </sales_order_printinvoice> 
    
        <sales_email_order_invoice_items> 
         <update handle="custom_invoice_totals" /> 
        </sales_email_order_invoice_items> 
    
        <sales_guest_invoice> 
         <update handle="custom_invoice_totals" /> 
        </sales_guest_invoice> 
    
        <!-- shipment pages --> 
        <sales_order_shipment> 
         <update handle="custom_shipment_totals" /> 
        </sales_order_shipment> 
    
        <sales_order_printshipment> 
         <update handle="custom_shipment_totals" /> 
        </sales_order_printshipment> 
    
        <sales_email_order_shipment_items> 
         <update handle="custom_shipment_totals" /> 
        </sales_email_order_shipment_items> 
    
        <sales_guest_shipment> 
         <update handle="custom_shipment_totals" /> 
        </sales_guest_shipment> 
    
        <!-- creditmemo pages --> 
        <sales_order_creditmemo> 
         <update handle="custom_creditmemo_totals" /> 
        </sales_order_creditmemo> 
    
        <sales_order_printcreditmemo> 
         <update handle="custom_creditmemo_totals" /> 
        </sales_order_printcreditmemo> 
    
        <sales_email_order_creditmemo_items> 
         <update handle="custom_creditmemo_totals" /> 
        </sales_email_order_creditmemo_items> 
    
        <sales_guest_creditmemo> 
         <update handle="custom_creditmemo_totals" /> 
        </sales_guest_creditmemo> 
    </layout> 
    

上前端的發貨總量將是沒有關於運輸方式的信息的所有頁面這樣的定製後...

0
在當地cart.phtml

,使用下面的代碼片段:

<div class="cart-totals-wrapper"> 
    <div class="cart-totals"> 
     <div class="cart-totals-container"> 
      <!-- <?php echo $this->getChildHtml('totals'); ?> --> 
      <?php 
       $_quote = Mage::getSingleton('checkout/session')->getQuote(); 
       $_cartValue = 0; 
       $_items = $_quote->getAllItems(); 
       foreach ($_items as $_item) { 
        $_cartValue += $_item->getRowTotalInclTax(); 
       } 
      ?> 
      <table id="shopping-cart-totals-table"> 
       <colgroup> 
        <col> 
        <col width="1"> 
       </colgroup> 
       <tbody> 
       <tr> 
        <td class="a-right" colspan="1" style=""><?php echo $this->__('Subtotal'); ?></td> 
        <td class="a-right" style=""> 
         <span class="price"><?php echo $_quote->getStore()->formatPrice($_cartValue); ?></span> 
        </td> 
       </tr> 
      </table> 
      <p class="message"><?php echo $this->__('Shipping will be calculated at checkout'); ?></p> 
     </div>