Remove Subtotal from Summary Section – One Step Checkout Plugin

checkoutmagento-1.9onestepcheckout

What is the best way to remove the subtotal section from the one step checkout plugin as shown in the screen shot? I also want to remove the VAT from the quantity price. I have attempted to edit in summary.phtml file but even when the total section is removed it still displays, I assume this is being over written by another file.

enter image description here

Thanks in advanced for your help.

Best Answer

First, to make changes to onestepcheckout, you should copy the summary.phtml file from the base theme, into your custom theme. This way it'll preserve the module's code.

Your version of summary.phtml will override the base version of summary.phtml.

Look in this file for the following code:

<tr<?php if ($total->getCode() == 'grand_total'): ?> class="grand-total"<?php endif; ?>>
    <td class="title">
    <?php
        $code = $total->getCode();
        $value = $total->getValue();

        if ($code == 'subtotal') {
            $total_name = $this->__('Subtotal');
        } elseif ($code == 'shipping') {
            $total_name = $this->__('Shipping');
            if ($checkoutHelper->settings['display_tax_included']) {
                $value += $this->getQuote()->getShippingAddress()->getShippingTaxAmount();
            }
        } elseif ($code == 'grand_total') {
            $total_name = $this->__('Grand total');
        } else {
            $total_name = $total->getTitle();
        }
        echo $total_name;
    ?>
    </td>
    <td class="value">
        <?php echo $this->helper('checkout')->formatPrice($value); ?>
    </td>
</tr>

This renders the totals rows from the Onestepcheckout's summary.

Wrap this full code in the following:

<?php if($total->getCode() != 'subtotal') { ?>
    // The above code
<?php } ?>

What you'll essentially be doing is saying if the code of each total in the loop is not 'subtotal', then print the row, if it is 'subtotal', then do nothing. This will disallow printing of the subtotal row entirely.

Related Topic