Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

show/update formated currencies in boxes


emkay

Recommended Posts

Posted

hi there,

I have a problem getting a simple feature to work.

I create a box that's supposed to shows

$currencies->format(MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER)

(which is the formated "free shipping over.." amount)

 

1) On the initial index page it shows "0".

the correct string appears only after you click some link and an osCsid session is added to the URL.

 

2) the same with e.g. "product_info.php".

You're viewing the product details page. Now when you change the displayed currency using the currency select box, the prices on the main product info page change to the desired currency. Fine.

But the currency in the box will only change after you click another link or reload the page.

 

My question: why? :-"

 

If I try the same with the

MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER

(unformated default amount) it works perfectly.

So I guess it's something with the "class currencies" not being loaded/updated in the boxes, right?

 

I know the formating class/function is in includes/classes/currencies.php but

why does $currencies only affect the main page, not the boxes?

 

could some kind soul point me in a direction?

thanks i.a.

Posted
hi there,

I have a problem getting a simple feature to work.

I create a box that's supposed to shows 

$currencies->format(MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER)

(which is the formated "free shipping over.." amount)

 

1) On the initial index page it shows "0".

the correct string appears only after you click some link and an osCsid session is added to the URL.

 

2) the same with e.g. "product_info.php".

You're viewing the product details page. Now when you change the displayed currency using the currency select box, the prices on the main product info page change to the desired currency. Fine.

But the currency in the box will only change after you click another link or reload the page.

 

My question: why?  :-"

 

If I try the same with the

MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER

(unformated default amount) it works perfectly.

So I guess it's something with the "class currencies" not being loaded/updated in the boxes, right?

 

I know the formating class/function is in includes/classes/currencies.php but

why does $currencies only affect the main page, not the boxes?

 

could some kind soul point me in a direction?

thanks i.a.

 

$currencies is a class instance created in application top.

however, if you want to use it within a function, you need to declare it in that function as global or pass it to the function.

Treasurer MFC

Posted
$currencies is a class instance created in application top.

however, if you want to use it within a function, you need to declare it in that function as global or pass it to the function.

 

thanks for the quick reply.

but what function would that be? Something in the box-creating-class in:

includes/classes/boxes.php?

 

I tried fiddling with

function infoBoxContents($contents)

and changing it to

function infoBoxContents($contents, $currencies)

but that didn't seem to be the whole story. (if at all, *ehem*)

 

PS: As you can tell I'm not really a pro so pls excuse if this may sound dumb.

Posted

some someone shed some more light on this please?

is that (see my last post above) the correct function for this issue?

 

thank you

  • 1 month later...
Posted

a new attempt:

anyone with a clue in which function I'd have to set that thingy global, pls?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...