Zen Cart Logo
Forums / Customization from the Admin / Admin Order Total Currency

Admin Order Total Currency

Locked

Views: 2,240

Results 1 to 11 of 11
This thread is locked. New replies are disabled.
15 Jan 2010, 12:39 AM
#1
mattclements avatar

mattclements

New Zenner

Join Date:
Aug 2009
Location:
Milton Keynes
Posts:
102
Plugin Contributions:
0

Admin Order Total Currency

Hello all,
My site uses 6 currencies (Exchange Rates updated overnight) the default is GBP.

However in the admin panel it shows (under the order list) an order in CAD as $12.25 - is there anyway of the order list showing all the values in GBP - converted at the rate of when the customer purchased the item?

I am talking about the Admin -> Customers -> Orders panel here

Regards,
Matt

16 Jan 2010, 10:30 AM
#2
mattclements avatar

mattclements

New Zenner

Join Date:
Aug 2009
Location:
Milton Keynes
Posts:
102
Plugin Contributions:
0

Re: Admin Order Total Currency

Any ideas?

16 Jan 2010, 10:43 AM
#3
absolute avatar

absolute

Totally Zenned

Join Date:
May 2005
Location:
Bath, Somerset
Posts:
1,054
Plugin Contributions:
2

Re: Admin Order Total Currency

Within each order record are three values you need to look at. There is the currency the order was placed in, the value of the order, and the currency exchange at time of pourchase. I believe, although I may be wrong, that the order_value is actually the value in your default currency. You would therefore need to just use this, along with the $currencies->format($order_value) function to show the order value in your default currency.

Where you place this code depends on what you want to do with it. As the customer has placed the order in CAD, I would probably add it to the bottom of the order totals, so that you have both totals there in front of you, just in case the customer ever queries it, and you need to see how much they actually paid in their currency.

Absolute

16 Jan 2010, 12:14 PM
#4
mattclements avatar

mattclements

New Zenner

Join Date:
Aug 2009
Location:
Milton Keynes
Posts:
102
Plugin Contributions:
0

Re: Admin Order Total Currency

That is correct - however I would like to keep thee report about each order the same - just the overview page.

Regards,
Matt

16 Jan 2010, 1:24 PM
#5
absolute avatar

absolute

Totally Zenned

Join Date:
May 2005
Location:
Bath, Somerset
Posts:
1,054
Plugin Contributions:
2

Re: Admin Order Total Currency

I nthat case, just find the current $currencies->format function, and remove the code which converts it into the order currency. You should then be left with $currencies->format($order->info['order_total']) or something similar depending on which page this is on. THat should do it for you.

Absolute

21 Jan 2010, 12:40 PM
#6
mattclements avatar

mattclements

New Zenner

Join Date:
Aug 2009
Location:
Milton Keynes
Posts:
102
Plugin Contributions:
0

Re: Admin Order Total Currency

Ok,
This is the code that shows the Order Total in a table:

<?php echo strip_tags($orders->fields['order_total']); ?>

Somehow I need to convert this to the default language.

Regards,
Matt

21 Jan 2010, 8:06 PM
#7
absolute avatar

absolute

Totally Zenned

Join Date:
May 2005
Location:
Bath, Somerset
Posts:
1,054
Plugin Contributions:
2

Re: Admin Order Total Currency

Lines 728, 740 and 752 add:

, o.order_total as base_order_value

Now replace the <?php echo strip_tags($orders->fields['order_total']); ?> with

<?php echo $currencies->format($orders->fields['base_order_value']); ?> 

Absolute

23 Jan 2010, 10:07 AM
#8
mattclements avatar

mattclements

New Zenner

Join Date:
Aug 2009
Location:
Milton Keynes
Posts:
102
Plugin Contributions:
0

Re: Admin Order Total Currency

Cheers - did something simular with the SQL Query to fix.

Regards,
Matt

14 Mar 2010, 7:33 PM
#9
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Admin Order Total Currency

Have been reading all of this post with great interest.. I have a few questions..

I want to be able to display the order totals (in the orders admin) in the default currency while retaining the original order totals (in the customer selected currency)

Have I read this thread (and the suggested changes) as being able to make this possible??

16 Mar 2010, 9:28 AM
#10
absolute avatar

absolute

Totally Zenned

Join Date:
May 2005
Location:
Bath, Somerset
Posts:
1,054
Plugin Contributions:
2

Re: Admin Order Total Currency

You need to decide on when the currency conversion will take effect. Obviously currencies change daily, so you have a choice. Do you want the price the order was valued at when they placed the order, or the price it is valued at now? The database stores the currency the order was placed in, and the value, and currency exchange rates. If you want to show the default currency now, you can use the code above to show this, but this will show the price at time of purchase.

Absolute

16 Mar 2010, 1:31 PM
#11
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Admin Order Total Currency

Absolute:

You need to decide on when the currency conversion will take effect. Obviously currencies change daily, so you have a choice. Do you want the price the order was valued at when they placed the order, or the price it is valued at now? The database stores the currency the order was placed in, and the value, and currency exchange rates. If you want to show the default currency now, you can use the code above to show this, but this will show the price at time of purchase.

AbsoluteCurrency at the time of purchase was what I was interested in.. So if this code does that, then that's what I was looking for.. Thanks!:smile: