Post by thegeekz » Wed Oct 24, 2012 5:21 pm

Hi,

I've been trying to amend the OC backend to show Subtotal with Tax for the original Subtotal, however its been difficult as it keeps having double or triple or further taxes added on after each save in the Order Admin - Totals tab.

** It was not very clear in my other thread, the overall coding ... how it can be solved fully... so that's why I'm asking for other opinions here... and check other alternatives... As I'm not a programmer, I hope an expert could give full instructions.

All Item Prices & Item Totals are supposed to be shown with Tax as well. :-\

So I've been thinking, is it possible to add in an additional one, retain the Original Subtotal (without Tax).. so it looks like this:

Item Price / Total
107.00 / 107.00

Subtotal : 100.00 (This original one I may hide or remove from view)

Subtotal Incl. Tax/GST : $107.00
GST Incl. : $7.00

Shipping : $5.00

Net Total : $ 112.00

Please state clearly how this can be done.... with the Item Price / Total with Tax as well.


Keeping in mind that I already have an extension that solves the front end -- Subtotal with Tax only. It appears that everytime I do something to the backend, the front end gets affected as well...

Thank you.

No more using Apsona, as they are not updated.

  • Every upgrade -- rem. 2 reinstall vqmod & mindful of modules w/ VQmod -- E.g Import / Export Tool by MHC


Active Member

Posts

Joined
Tue Nov 02, 2010 10:24 am

Post by bigal » Wed Oct 24, 2012 7:14 pm

Try this one. Just change display of sub-total to include tax.

go to system -> settings -> store edit -> option -> Display Prices With Tax: set to yes so that products display includes tax.

modify the file
/catalog/model/total/sub_total.php
after $sub_total = $this->cart->getSubTotal();
put below code to get subtotal + tax

Code: Select all

$tax_total = $this->cart->getTaxes();
$tax_value = 0; // initialize tax;
foreach($tax_total as $value){
 $tax_value = $tax_value + $value;
}
$display_sub_total = $sub-total + $tax_value;
in the $total_data[] = array,, change the 'text' => .. line $sub_total to $display_sub_total

Code: Select all

'text'       => $this->currency->format($display_sub_total),

Best Regards/Allen Chen


Active Member

Posts

Joined
Wed Sep 21, 2011 9:02 am

Post by thegeekz » Wed Oct 24, 2012 8:19 pm

bigal wrote:Try this one. Just change display of sub-total to include tax.

go to system -> settings -> store edit -> option -> Display Prices With Tax: set to yes so that products display includes tax.

modify the file
/catalog/model/total/sub_total.php
after $sub_total = $this->cart->getSubTotal();
put below code to get subtotal + tax

Code: Select all

$tax_total = $this->cart->getTaxes();
$tax_value = 0; // initialize tax;
foreach($tax_total as $value){
 $tax_value = $tax_value + $value;
}
$display_sub_total = $sub-total + $tax_value;
in the $total_data[] = array,, change the 'text' => .. line $sub_total to $display_sub_total

Code: Select all

'text'       => $this->currency->format($display_sub_total),
Hmm so this is to solve the Subtotals + Tax issue... Hmm..

I have long since had the Display Prices with Tax checked. so that's not an issue.

Now the issue in the backend si more of the Subtotal and the Item Price/Total that does not show the correct amount + tax.

Will this solve the issue at the backend then? Where we manage our Orders and the Invoice printout?


Will try your solution later and update.

No more using Apsona, as they are not updated.

  • Every upgrade -- rem. 2 reinstall vqmod & mindful of modules w/ VQmod -- E.g Import / Export Tool by MHC


Active Member

Posts

Joined
Tue Nov 02, 2010 10:24 am

Post by bigal » Wed Oct 24, 2012 8:45 pm

looks like sub_total text are saved as text in order_total table.
You'd only see the new sub_total on new orders only.

Best Regards/Allen Chen


Active Member

Posts

Joined
Wed Sep 21, 2011 9:02 am

Post by thegeekz » Wed Oct 24, 2012 8:56 pm

bigal wrote:looks like sub_total text are saved as text in order_total table.
You'd only see the new sub_total on new orders only.
Thanks Bigal.

I hope it will also help in making the Item price / Item total show the figure + tax, as once I remove the problematic fix I'm trying earlier... The Item price / Total wil revert to $100 (not + tax price)

Item Price / Total : 100.00

Subtotal : 100.00


Tax Incl : 7.00

Net Total : 107.00

I'll need to make sure Item Price / Total in Order Admin and Invoice will be $107.00, and not 100.00 as well.

No more using Apsona, as they are not updated.

  • Every upgrade -- rem. 2 reinstall vqmod & mindful of modules w/ VQmod -- E.g Import / Export Tool by MHC


Active Member

Posts

Joined
Tue Nov 02, 2010 10:24 am

Post by bigal » Wed Oct 24, 2012 9:07 pm

For item price + tax. You just configure system store option to display price with tax.

Best Regards/Allen Chen


Active Member

Posts

Joined
Wed Sep 21, 2011 9:02 am

Post by thegeekz » Wed Oct 24, 2012 9:10 pm

Bigal : I applied your fix.. Error showed on home page

Notice: Use of undefined constant total - assumed 'total' in /home/cybermin/public_html/oc9/vqmod/vqcache/vq2-catalog_model_total_sub_total.php on line 13Notice: Undefined variable: sub in /home/cybermin/public_html/oc9/vqmod/vqcache/vq2-catalog_model_total_sub_total.php on line 13

and when I press Update totals : error box shows :

SyntaxError: JSON.parse: unexpected character

OK

<b>Notice</b>: Use of undefined constant total - assumed 'total' in <b>/home/cybermin/public_html/oc9/vqmod/vqcache/vq2-catalog_model_total_sub_total.php</b> on line <b>13</b><b>Notice</b>: Undefined variable: sub in <b>/home/cybermin/public_html/oc9/vqmod/vqcache/vq2-catalog_model_total_sub_total.php</b> on line <b>13</b>{"order_product":[{"product_id":"28","name":"HTC Touch HD","model":"Product 1","option":[],"download":[],"quantity":1,"price":100,"total":100,"tax":7,"reward":400},{"product_id":"41","name":"iMac","model":"Product 14","option":[],"download":[],"quantity":1,"price":100,"total":100,"tax":7,"reward":0}],"order_voucher":[],"shipping_method":{"flat":{"title":"Flat Rate","quote":{"flat":{"code":"flat.flat","title":"Flat Shipping Rate","cost":"5.00","tax_class_id":"0","text":"S$ 5.00"}},"sort_order":"1","error":false}},"order_total":[{"code":"sub_total","title":"Sub-Total Inc. GST","text":"S$ 14.00","value":200,"sort_order":"1"},{"code":"tax","title":"GST 7% Incl.","text":"S$ 14.00","value":14,"sort_order":"5"},{"code":"shipping","title":"Flat Shipping Rate","text":"S$ 5.00","value":"5.00","sort_order":"6"},{"code":"total","title":"Net Total","text":"S$ 219.00","value":219,"sort_order":"9"}],"payment_methods":[],"payment_method":{"cod":{"code":"cod","title":"Cash On Delivery","sort_order":"5"}},"success":"Success: Your Advanced Coupon discount has been applied!"}

So it seems , we can't do it this way?

No more using Apsona, as they are not updated.

  • Every upgrade -- rem. 2 reinstall vqmod & mindful of modules w/ VQmod -- E.g Import / Export Tool by MHC


Active Member

Posts

Joined
Tue Nov 02, 2010 10:24 am

Post by thegeekz » Wed Oct 24, 2012 9:15 pm

bigal wrote:For item price + tax. You just configure system store option to display price with tax.
Configured, but the backend still shows this:
Image 1.jpg

Image 1.jpg (50.42 KiB) Viewed 18046 times

This was before I applied the problematic fix in the other thread... which didn't work properly.

Essentially.. Invoice will be like this: (this is after Pressing Update Totals in the Order Admin, Totals tab)
Image 2.jpg

Image 2.jpg (58.38 KiB) Viewed 18046 times

Before Pressing update totals, the Subtotal was correct : $214.

No more using Apsona, as they are not updated.

  • Every upgrade -- rem. 2 reinstall vqmod & mindful of modules w/ VQmod -- E.g Import / Export Tool by MHC


Active Member

Posts

Joined
Tue Nov 02, 2010 10:24 am

Post by thegeekz » Wed Oct 24, 2012 9:19 pm

So as you can see, I need to solve a few issues around this:

1) Item Price / Total -- Bug (Display price with Tax checked yet show without Tax in backend)

2) Subtotals with Tax

From what I gathered from another expert earlier, the Update Totals Button is linked to : catalog/controller/checkout/manual.php. In which I can't seem to solve it partly due to unable to define Subtotal + Tax there.

See this previous thread (gone messy with me keep asking him to give me straight to the point answers....)
http://forum.opencart.com/viewtopic.php?f=20&t=86448

No more using Apsona, as they are not updated.

  • Every upgrade -- rem. 2 reinstall vqmod & mindful of modules w/ VQmod -- E.g Import / Export Tool by MHC


Active Member

Posts

Joined
Tue Nov 02, 2010 10:24 am

Post by bigal » Wed Oct 24, 2012 9:27 pm

sorry..

typo.. had - instead of _

Code: Select all

$tax_total = $this->cart->getTaxes();
$tax_value = 0; // initialize tax;
foreach($tax_total as $value){
 $tax_value = $tax_value + $value;
}
$display_sub_total = $sub_total + $tax_value;

Best Regards/Allen Chen


Active Member

Posts

Joined
Wed Sep 21, 2011 9:02 am

Post by bigal » Wed Oct 24, 2012 9:41 pm

I saw your previous link.. I am pretty much wanting the same display.

I applied it on my local enviroment.
front end and backend matches.

I am just using default v1.5.4.1 install without addons.

Best Regards/Allen Chen


Active Member

Posts

Joined
Wed Sep 21, 2011 9:02 am

Post by thegeekz » Thu Oct 25, 2012 10:04 am

bigal wrote:I saw your previous link.. I am pretty much wanting the same display.

I applied it on my local enviroment.
front end and backend matches.

I am just using default v1.5.4.1 install without addons.
Ok will try again.

Curious to know if this will work too... as I have a front end extension installed that take cares only of the front end.... :(

No more using Apsona, as they are not updated.

  • Every upgrade -- rem. 2 reinstall vqmod & mindful of modules w/ VQmod -- E.g Import / Export Tool by MHC


Active Member

Posts

Joined
Tue Nov 02, 2010 10:24 am

Post by thegeekz » Tue Nov 06, 2012 3:07 pm

Hi Bigal,

After applying the code you indicated earlier, The Invoice seems to work now with Subtotal incl. GST/ TAX.

But the Order Admin backend still shows :

Item : 100.00

Subtotal : 100.00

Tax: 7.00

Grand Total : 107.00


Not sure in your test environment, did you managed to get the Admin Order backend (Totals Tab) -- Order Summary to show:

Item : 107.00

Subtotal : 107.00

Tax : 7.00

Grand Total : 107.00

-- With Tax for both Item and Subtotal?


Thank you.
Image OC1.jpg

Invoice Printout - OK now. - Image OC1.jpg (46.36 KiB) Viewed 17942 times


No more using Apsona, as they are not updated.

  • Every upgrade -- rem. 2 reinstall vqmod & mindful of modules w/ VQmod -- E.g Import / Export Tool by MHC


Active Member

Posts

Joined
Tue Nov 02, 2010 10:24 am

Post by bigal » Mon Jan 07, 2013 6:44 pm

Yes, with the new orders, it display the same for both.

Best Regards/Allen Chen


Active Member

Posts

Joined
Wed Sep 21, 2011 9:02 am

Post by DTrain » Thu Apr 11, 2013 6:21 pm

Hi guys,

I know it has been awhile since you covered this, but do you have the exact example of how to fix it in the backend as well as the invoice.

I have got the front-end for the customer working fine, but once they finalise the order it doesn't show the Subtotal inc. Tax.

Please help as I'm trying to finalise my store for a client asap.

Cheers,

Dallas

Newbie

Posts

Joined
Sat Mar 03, 2012 12:03 pm
Who is online

Users browsing this forum: No registered users and 2 guests