Site maintenance: Tuesday 17 Nov, from 10:00 UTC, about 4–6 hours. Details

This cutover relies on some testing that is still incomplete so may be cancelled at short notice

Forums / General Questions / displaying a price effected by currency.

displaying a price effected by currency.

Locked

Started by caborela on 21 Feb 2009, 3:32 PM · Views: 1,010

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
21 Feb 2009, 3:32 PM
#1
caborela avatar

caborela

New Zenner

Join Date:
Dec 2008
Posts:
36
Plugin Contributions:
0

displaying a price effected by currency.

i want to display a price which will automatically change if different currency is selected.

For example on discount information page.
10% discount for the order over US $100.

if customer select GB Pound currency, then it can automatically change to:
10% discount for the order over GB £70

how can i do it?

thanks for any answers.

21 Feb 2009, 5:47 PM
#2
bunyip avatar

bunyip

Totally Zenned

Join Date:
Sep 2004
Location:
Western Massachusetts
Posts:
2,361
Plugin Contributions:
1

Re: displaying a price effected by currency.

Make an override copy of includes/languages/english/discount_coupon.php and replace these two lines

define('TEXT_COUPON_HELP_FIXED', '');
define('TEXT_COUPON_HELP_MINORDER', '');

with

define('TEXT_COUPON_HELP_FIXED', '%s off');
define('TEXT_COUPON_HELP_MINORDER', ' for orders over %s');

Then edit your coupon and leave the description completely blank. The displayed currency for the minimim order value will then automatically change according to the selection the customer has made, and the currency exchange value you have set for your currencies.

You will find that the percentage off will be shown with 2 decimal places, ie 10.00% off for orders over $100
If you want to change that so the percentage is shown with no decimal places, you need to replace this line in includes/modules/pages/discount_coupon/header_php.php

        $text_coupon_help .= sprintf(TEXT_COUPON_HELP_FIXED, number_format($coupon->fields['coupon_amount'],2). '%');

with ```
$text_coupon_help .= sprintf(TEXT_COUPON_HELP_FIXED, number_format($coupon->fields['coupon_amount'],0). '%');

Neville
An assumption is what you arrive at when you get tired of thinking...

27 Feb 2009, 4:30 AM
#3
caborela avatar

caborela

New Zenner

Join Date:
Dec 2008
Posts:
36
Plugin Contributions:
0

Re: displaying a price effected by currency.

Thank you bunyip!!!

i will give it a try!
:clap:

27 Feb 2009, 6:18 AM
#4
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: displaying a price effected by currency.

This is what you should use

echo $currencies->format(100);

I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

4 Mar 2009, 4:20 AM
#5
caborela avatar

caborela

New Zenner

Join Date:
Dec 2008
Posts:
36
Plugin Contributions:
0

Re: displaying a price effected by currency.

Great Thanks to Yellow1912

it works perfect!!!
:clap::clap::clap: