0

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.

2 Answers 2

0

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.

3
  • Thank you so much that worked perfectly. Do you know how to display VAT row below delivery as well?
    – Calum
    Feb 4, 2015 at 11:44
  • No problem, glad to help. To reorder would be a little more complex. The loop just looks at them one at a time in an order, so really, prior to the open of the loop, you'd need to sort them. Perhaps open a new question so we can treat it as such :)
    – Dan Hanly
    Feb 4, 2015 at 12:08
  • I've added this as another question. magento.stackexchange.com/questions/54441/…
    – Calum
    Feb 4, 2015 at 12:29
0

In your onestep checkout module,please do the following:

1.Find one step checkout template file checkout/onestep/reviews/total.phtml

2.find the line

echo $this->renderTotals(null, $_colspan);

3.hide or remove this code.

4.This will remove the subtotal.

Hope this will help

1
  • This will not work, as he's using 'Onestepcheckout' a third-party checkout module. The changes would need to be made to the 'Onestepcheckout' module, rather than the core checkout module.
    – Dan Hanly
    Feb 4, 2015 at 11:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.