0

对于 RWD 主题,v1.9.2.1,有没有办法在提交订单之前显示小计、运输和总计,作为最后一个审查块?

根据:app/design/frontend/rwd/default/layout/checkout.xml:

<!-- One page checkout order review block -->

<checkout_onepage_review translate="label">
    <label>One Page Checkout Overview</label>
    <!-- Mage_Checkout -->
    <remove name="right"/>
    <remove name="left"/>

    <block type="checkout/onepage_review_info" name="root" output="toHtml" template="checkout/onepage/review/info.phtml">
        <action method="addItemRender"><type>default</type><block>checkout/cart_item_renderer</block><template>checkout/onepage/review/item.phtml</template></action>
        <action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>checkout/onepage/review/item.phtml</template></action>
        <action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>checkout/onepage/review/item.phtml</template></action>


 <block type="checkout/cart_totals" name="checkout.onepage.review.info.totals" as="totals" template="checkout/onepage/review/totals.phtml"/>
        <block type="core/text_list" name="checkout.onepage.review.info.items.before" as="items_before" translate="label">
            <label>Items Before</label>
        </block>
        <block type="core/text_list" name="checkout.onepage.review.info.items.after" as="items_after" translate="label">
            <label>Items After</label>
        </block>
        <block type="checkout/agreements" name="checkout.onepage.agreements" as="agreements" template="checkout/onepage/agreements.phtml"/>
        <block type="core/template" name="checkout.onepage.review.button" as="button" template="checkout/onepage/review/button.phtml"/>
    </block>
    <block type="core/text_list" name="additional.product.info" translate="label">
        <label>Additional Product Info</label>
    </block>
</checkout_onepage_review>

似乎没有执行此行:

<block type="checkout/cart_totals" name="checkout.onepage.review.info.totals" as="totals" template="checkout/onepage/review/totals.phtml"/>

我有:app/design/frontend/rwd/default/template/checkout/onepage/review/totals.phtml:

/**
 * @see Mage_Checkout_Block_Cart_Totals
 */
?>
<?php if ($this->getTotals()): ?>
<tfoot>
    <?php $_colspan = $this->helper('tax')->displayCartBothPrices() ? 5 : 3; ?>
    <?php // echo $this->renderTotals(null, $_colspan); ?>
    <?php echo $this->renderTotals('footer', $_colspan); ?>
    <?php if ($this->needDisplayBaseGrandtotal()):?>
    <tr>
        <td class="a-right" colspan="<?php echo $_colspan; ?>">
            <small><?php echo $this->helper('sales')->__('Your credit card will be charged for') ?></small>
        </td>
        <td class="a-right">
            <small><?php echo $this->displayBaseGrandtotal() ?></small>
        </td>
    </tr>
    <?php endif?>
</tfoot>
<?php endif; ?>

任何帮助将不胜感激!

4

1 回答 1

0

我找到了一个解决方案:

app/design/frontend/rwd/default/template/checkout/onepage/review/totals.phtml

<?php

    $quote = Mage::getSingleton('checkout/session')->getQuote();
    $totalQuantity = $quote->getItemsQty();
    $subTotal = $quote->getSubtotal();
    $grandTotal = $quote->getGrandTotal();
    $shippingTotal = $grandTotal - $subTotal;

?>


<?php if ($this->getTotals()): ?>
<tfoot>
    <?php $_colspan = $this->helper('tax')->displayCartBothPrices() ? 5 : 3; ?>
    <?php // echo $this->renderTotals(null, $_colspan); ?>
    <?php echo $this->renderTotals('footer', $_colspan); ?>

    <tr>
        <td class="a-right" colspan="<?php echo $_colspan; ?>">
            <?php echo $this->helper('sales')->__('Subtotal') ?>
        </td>
        <td class="a-right">
            <?php echo Mage::helper('core')->currency($subTotal,true,false);  ?>
        </td>
    </tr>

    <tr>
        <td class="a-right" colspan="<?php echo $_colspan; ?>">
            <?php echo $this->helper('sales')->__('Shipping & Handling') ?>
        </td>
        <td class="a-right">
            <?php echo Mage::helper('core')->currency($shippingTotal,true,false); ?>
        </td>
    </tr>

    <tr>
        <td class="a-right" colspan="<?php echo $_colspan; ?>">
            <strong><?php echo $this->helper('sales')->__('Your credit card will be charged for') ?></strong>
        </td>
        <td class="a-right">
            <strong><?php echo $this->displayBaseGrandtotal() ?></strong>
        </td>
    </tr>
</tfoot>
<?php endif; ?>
于 2015-08-16T19:40:18.983 回答