Zen Cart Logo
Forums / Bug Reports / total in $order

total in $order

Locked

Views: 4,597

Results 1 to 20 of 20
This thread is locked. New replies are disabled.
4 Jul 2007, 6:51 PM
#1
talvins avatar

talvins

New Zenner

Join Date:
Mar 2007
Posts:
21
Plugin Contributions:
0

total in $order

Hi,

Everything works well, the order has its VAT and postal fees.

On the other hand, once on the payment page of the bank (using the ATOS module, for french bank), the total displayed is the product price + price tax + postal charges WITHOUT tax. The VAT of postal charges disappeared.

I dont' know why, but $order->info['total'] change between ot_total.php and ATOS atos.php.

Do you know why ?

Thanks.

24 Jul 2007, 10:31 AM
#2
talvins avatar

talvins

New Zenner

Join Date:
Mar 2007
Posts:
21
Plugin Contributions:
0

Re: total in $order

Hi,

On the '?main_page=checkout_payment' (and after), the order_total module gives me the right total (product price + product tax + shipping + shipping tax) but if I read the object $order (print_r $order) on the same page, I have for total : product price + product tax + shipping, without shipping tax.

So, when I use credit card module or other e-payment, the total is wrong !

I have already looked everywhere, now, I'm lost...

Thank you.

25 Jul 2007, 9:00 AM
#3
talvins avatar

talvins

New Zenner

Join Date:
Mar 2007
Posts:
21
Plugin Contributions:
0

Re: total in $order

Hi,

I hope not to make a mistake by posting here.
On a new installation, without any modification, I have this problem :

On the '?main_page=checkout_payment' (and after), the order_total module gives me the right total (product price + product tax + shipping + shipping tax) but if I read the object $order (print_r $order) on the same page, I have for total : product price + product tax + shipping, without shipping tax.

So, when I use credit card module or other e-payment, the total is wrong !

$order['info'] gives :```
[info] => Array
(
[order_status] => 1
[currency] => EUR
[currency_value] => 1.00000000
[payment_method] =>
[payment_module_code] =>
[coupon_code] =>
[shipping_method] => Frais de Livraison (Montant)
[shipping_module_code] => flat_flat
[shipping_cost] => 5.00
[subtotal] => 100
[tax] => 15.9663865546
[total] => 105
[tax_groups] => Array
(
[TVA 19,6%] => 15.9663865546
)

        [comments] => 
        [ip_address] => 127.0.0.1 - 127.0.0.1
    )

The total shown with order_total module is OK ! Shipping tax is included and total is right (105.95 for this example).

Thanks.
25 Jul 2007, 2:47 PM
#5
talvins avatar

talvins

New Zenner

Join Date:
Mar 2007
Posts:
21
Plugin Contributions:
0

Re: total in $order

Yes, absolutly. Sorry for the multiple posts but now, I can say it's kind of a bug.

25 Jul 2007, 3:49 PM
#6
talvins avatar

talvins

New Zenner

Join Date:
Mar 2007
Posts:
21
Plugin Contributions:
0

Re: total in $order

I've just tried to print $order in different part of the index.php?main_page=checkout_payment

In includes\modules\pages\checkout_payment\header_php.php :

[info] => Array
        (
            [order_status] => 1
            [currency] => EUR
            [currency_value] => 1.00000000
            [payment_method] => 
            [payment_module_code] => 
            [coupon_code] => 
            [shipping_method] => Envoi Colissimo (Colissimo suivi + assurance)
            [shipping_module_code] => colissimo_colissimo
            [shipping_cost] => 5.1
            [subtotal] => 100
            [tax] => 16.3879598662
            [total] => 105.1
            [tax_groups] => Array
                (
                    [TVA Intra] => 16.3879598662
                )

In includes\classes\order_total.php : same as above

In includes\modules\order_total\ot_total.php (which gives the good result : 5.1 + 19.6% = 6.1) :

[info] => Array
        (
            [order_status] => 1
            [currency] => EUR
            [currency_value] => 1.00000000
            [payment_method] => 
            [payment_module_code] => 
            [coupon_code] => 
            [shipping_method] => Envoi Colissimo (Colissimo suivi + assurance)
            [shipping_module_code] => colissimo_colissimo
            [shipping_cost] => 6.1
            [subtotal] => 100
            [tax] => 17.3879598662
            [total] => 106.1
            [tax_groups] => Array
                (
                    [TVA Intra] => 17.3879598662
                )
25 Jul 2007, 8:13 PM
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: total in $order

What version of Zen Cart are you using?
Please post your atos.php module code here.

25 Jul 2007, 9:37 PM
#8
talvins avatar

talvins

New Zenner

Join Date:
Mar 2007
Posts:
21
Plugin Contributions:
0

Re: total in $order

I'm using 1.3.7 + your patches (1.3.8, 1.4.0)

I was wrong when I said there's a link with atos because the page I use to show the problem (index.php?main_page=checkout_payment) is similar on all the zencart installation and don't use the payment module atos.php.

I really don't understand why, on the same page, we can have two different values for $order->info['total'] and why the right value is only on includes\modules\order_total\ot_total.php !

Thank you for your help.

29 Jul 2007, 1:33 PM
#9
talvins avatar

talvins

New Zenner

Join Date:
Mar 2007
Posts:
21
Plugin Contributions:
0

Re: total in $order

So, you have no idea ?

30 Jul 2007, 6:02 AM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: total in $order

I'm trying to figure out why the payment module you're using is having problems when all the other payment modules are working fine ...

30 Jul 2007, 6:54 AM
#11
talvins avatar

talvins

New Zenner

Join Date:
Mar 2007
Posts:
21
Plugin Contributions:
0

Re: total in $order

But then, it's normal to have different value for $order->info['total'] ? Even in the classes/modules included in the ZenCart installation ?

It's really a big mystery for me...

7 Aug 2007, 6:58 AM
#12
talvins avatar

talvins

New Zenner

Join Date:
Mar 2007
Posts:
21
Plugin Contributions:
0

Re: total in $order

No news, I'm dead...

Losting money on each sale. :cry:

14 Aug 2007, 11:01 PM
#13
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: total in $order

What are your settings for these:

  • Admin->Configuration->My Store->Display Prices With Tax
  • Admin->Configuration->My Store->Basis of Product Tax
  • Admin->Configuration->My Store->Basis of Shipping Tax
  • Admin->Modules->Shipping->Envoi Colissimo->Tax Class
  • Admin->Modules->Shipping->Envoi Colissimo->Tax Basis
  • Admin->Modules->Shipping->Envoi Colissimo->Shipping Zone
15 Aug 2007, 8:46 AM
#14
talvins avatar

talvins

New Zenner

Join Date:
Mar 2007
Posts:
21
Plugin Contributions:
0

Re: total in $order

DrByte:

What are your settings for these:

  • Admin->Configuration->My Store->Display Prices With Tax

true

  • Admin->Configuration->My Store->Basis of Product Tax

billing (but also try shipping)

  • Admin->Configuration->My Store->Basis of Shipping Tax

shipping

  • Admin->Modules->Shipping->Envoi Colissimo->Tax Class

TVA

  • Admin->Modules->Shipping->Envoi Colissimo->Tax Basis

billing (also try shipping)

  • Admin->Modules->Shipping->Envoi Colissimo->Shipping Zone

No field. There are Zone1 countries, Zone2 coutries,...
Prices in this shipping module are without taxes.

Thanks.

15 Aug 2007, 12:06 PM
#15
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: total in $order

The values are different at various stages of checkout due to the various calculations that must be done in a certain order.

Where exactly are you attempting to extract information for use in these other places?

15 Aug 2007, 12:08 PM
#16
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: total in $order

talvins:

Prices in this shipping module are without taxes.But I thought you were complaining that it wasn't showing tax for shipping ... and now you're saying that you don't need tax on this module?

15 Aug 2007, 12:09 PM
#17
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: total in $order

talvins:

Admin->Configuration->My Store->Display Prices With Tax** = true**Does it calculate properly if you set this to FALSE ?

16 Aug 2007, 9:30 AM
#18
talvins avatar

talvins

New Zenner

Join Date:
Mar 2007
Posts:
21
Plugin Contributions:
0

Re: total in $order

DrByte:

The values are different at various stages of checkout due to the various calculations that must be done in a certain order.

Where exactly are you attempting to extract information for use in these other places?

As I said, on the same page index.php?main_page=checkout_payment, in 3 different parts : includes/modules/order_total/ot_total.php, includes/classes/order_total.php and includes/modules/pages/checkout_payment/header_php.php

But I thought you were complaining that it wasn't showing tax for shipping ... and now you're saying that you don't need tax on this module?Prices in this shipping module are without taxes, as prices for object BUT taxes will be (MUST BE) added according to the shipping/billing country.
It's ok for prices, but not for shipping (and it's not work for other modules like "flat").

Does it calculate properly if you set this to FALSE ?If Display Prices With Tax is set to FALSE, prices are shown without taxes and shpping too. Normal.

16 Aug 2007, 10:09 AM
#19
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: total in $order

talvins:

If Display Prices With Tax is set to FALSE, prices are shown without taxes and shpping too. Normal.

So, the calculations are all correct -- EVERYWHERE if you have Display Prices With Tax set to false?

20 Aug 2007, 7:55 AM
#20
talvins avatar

talvins

New Zenner

Join Date:
Mar 2007
Posts:
21
Plugin Contributions:
0

Re: total in $order

No, if it's set to FALSE, only prices are midified. Totals are the same as before.