Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does the OpenCart SubTotal and Order Total are appear twice?

Tags:

opencart

I have OpenCart installed. The cart page shows Total and Subtotal twice. It will not show the final Total too. The gift voucher is also appearing even if a customer has not added it to their cart. Is their a solution? Do I need to edit my settings in the Admin?

like image 420
Naveenbos Avatar asked Nov 07 '12 13:11

Naveenbos


2 Answers

Sub total is used for main price that does not include any tax or vat, and total shows final price that includes all things TAX, VAT and gift voucher or coupon.

and there may be you have not cleared cache from vqmod, so it may conflict your prices and place of prices that you have placed.

like image 143
vishal ramani Avatar answered Nov 15 '22 20:11

vishal ramani


Assuming sub-total is ordered before total. This will check if they have the same value.

<file path="catalog/controller/" name="checkout/cart.php,checkout/confirm.php,module/cart.php">
    <operation>
        <search position="before"><![CDATA[
        $this->data['totals'] = $total_data;
        ]]></search>
        <add><![CDATA[
        // Remove sub-total is same as total
        foreach($total_data as $i => $result){
            if($result['code'] == 'sub_total' && $total_data[$i+1]['code'] == 'total' && $result['value'] == $total_data[$i+1]['value']){
                unset($total_data[$i]);
            }
        }
      ]]></add>
    </operation>
</file>
like image 33
John Magnolia Avatar answered Nov 15 '22 19:11

John Magnolia