PrestaShop Forums: [MODULE] Force Currency - PrestaShop Forums

Jump to content


Welcome to the PrestaShop Forum! We hope you'll share your comments and suggestions with us. We ask that you please post in English to the main sections of the PrestaShop Forum. If you want to write in another language, please post in the corresponding PrestaShop Community section below.

Please note that PrestaShop Community sections are largely self-moderated. PrestaShop team members may or may not participate in non-English sections. To improve the chances of receiving feedback to your question or comment, please post it in English to the main sections of our Forum.

NYC

Vous parlez français ? par ici !


[MODULE] Force Currency


[MODULE] Force Currency

#1 clokwise

    PrestaShop Apprentice

  • 16 Nov 2008
  • Members
  • PipPip
  • 40 posts

Posted 23 December 2008 - 12:46 PM

This module allows your store to manage inventory in one currency, and sell in another. For example your default currency is Euros, but you want to sell your products to the USA, in Dollars. So add US Dollars as a currency to your shop, then install this module and configure US Dollars as the forced currency. Even if you have the Currency Block module installed, your customers will not be able to select another currency. Your currency in the Back Office will remain the default currency, Euros, in this example.

Limitations:
Obviously you can only use one default shop currency and one forced currency. If you have other currencies installed they will not be able to be used.

On the first page load, you may notice a page refresh. This is the only way I could manage to refresh the currency cookie and reload the currencies. If anyone has a better solution please feel free to update this code. Likewise, you will see a refresh after configuring the module. If there is a better solution - please contribute.

Installation:

After installing the module, for best performance, you must use the Module "Positions" sub-tab and move this module to the very first position in the "Top of pages" block.

About:
I built this module for my own business use, and am freely sharing it. This module however is totally unsupported! Do not expect me to make fixes, or answer any questions by email or in the Prestashop forum. I just don't have time. If I make any updates to this code, I will post them, but that's it. Sorry.

Attached File(s)



#2 Marghoob Suleman

    PrestaShop Apprentice

  • 05 Sep 2008
  • Members
  • PipPip
  • 134 posts

Posted 23 December 2008 - 08:13 PM

Thanks for sharing... I'll check this...
Now Online (23rd May 2009): Gift Le Lo
Marghoob Suleman
Guys please do not make any test order on my site. You are welcome to visit and shop :)

#3 hieloiceberg

    PrestaShop Apprentice

  • 15 Nov 2008
  • Members
  • PipPip
  • 480 posts

Posted 23 December 2008 - 11:18 PM

Thanks for sharing clokwise
FarmVille Addict ;-)

#4 Hungnh

    PrestaShop Apprentice

  • 09 Jul 2008
  • Members
  • PipPip
  • 36 posts

Posted 24 December 2008 - 02:36 AM

Thanks for sharing everyone.

MERRY CHRISTMAS!


#5 clokwise

    PrestaShop Apprentice

  • 16 Nov 2008
  • Members
  • PipPip
  • 40 posts

Posted 24 December 2008 - 02:42 AM

One additional note: You also need to go to the Payments tab and under "Payment module restrictions" select the same currency you forced with the module for each payment method. Otherwise your customers will instead see your default currency when they pay (at PayPal or wherever).

#6 noexperience

    PrestaShop Apprentice

  • 17 Sep 2008
  • Members
  • PipPip
  • 83 posts
  • Location:Bucuresti

Posted 18 March 2009 - 01:57 PM

not working under COD module (Cash on delivery )
Need help

#7 Dio

    PrestaShop Apprentice

  • 22 Nov 2008
  • Members
  • PipPip
  • 134 posts

Posted 18 March 2009 - 02:38 PM

Thanks for sharing…

#8 supness

    PrestaShop Newbie

  • 07 Apr 2009
  • Members
  • Pip
  • 4 posts

Posted 07 April 2009 - 10:03 PM

i dont think the problem is solved. the module just changes the frontend currency, how about backend? i did install your module, but the admin control panel is still euro, how can i use pounds in the admin panel? thanks

#9 Paul Bogdan

    PrestaShop Newbie

  • 05 Jan 2009
  • Members
  • Pip
  • 20 posts

Posted 07 May 2009 - 10:05 PM

this module have a lot of bugs

first one is that the forced currency is not working on featured products EVER

#10 Paul Bogdan

    PrestaShop Newbie

  • 05 Jan 2009
  • Members
  • Pip
  • 20 posts

Posted 26 May 2009 - 08:40 AM

I think that the problem is from the homefeatured module, I found this code in homefeatured.php this one could be the problem.

if anyone knows how to figured out this... many 10x

    function hookHome($params)
{
global $smarty;
$category = new Category(1);
$nb = intval(Configuration::get('HOME_FEATURED_NBR'));
$products = $category->getProducts(intval($params['cookie']->id_lang), 1, ($nb ? $nb : 10), 'date_add', 'DESC');
$smarty->assign(array(
'allow_buy_when_out_of_stock' => Configuration::get('PS_ORDER_OUT_OF_STOCK', false),
'max_quantity_to_allow_display' => Configuration::get('PS_LAST_QTIES'),
'category' => $category,
'products' => $products,
'currency' => new Currency(intval($params['cart']->id_currency)),
'lang' => Language::getIsoById(intval($params['cookie']->id_lang)),
'productNumber' => sizeof($products)
));
return $this->display(__FILE__, 'homefeatured.tpl');
}

}


#11 likeminded

    PrestaShop Apprentice

  • 15 Jul 2008
  • Members
  • PipPip
  • 42 posts

Posted 11 August 2009 - 11:42 PM

This Module Didnt work for me just sent my page in to a refresh loop after configuring

#12 Radu

    PrestaShop Addict

  • 07 Mar 2009
  • Moderators
  • 571 posts
  • Location:Bucharest

Posted 04 September 2009 - 06:43 PM

if you don't want to use a module make this modifications:

in init.php before:
$currency = Tools::setCurrency();

add:
$cookie->id_currency = intval(Configuration::get('PS_CURRENCY_FRONT_DEFAULT'));


in admin/tabs/AdminCurrencies.php after:
'PS_CURRENCY_DEFAULT' => array('title' => $this->l('Default currency:'), 'desc' => $this->l('The default currency used in shop'), 'cast' => 'intval', 'type' => 'select', 'identifier' => 'id_currency', 'list' => Currency::getCurrencies()),

add:
'PS_CURRENCY_FRONT_DEFAULT' => array('title' => $this->l('Default currency front:'), 'desc' => $this->l('The default currency used in front shop'), 'cast' => 'intval', 'type' => 'select', 'identifier' => 'id_currency', 'list' => Currency::getCurrencies()),


that's it! now go to admin->payment->currencies and set up your default shop currency. Customer CAN change the currency if needed.
www.cureducere.ro -> cumperi online de la partenerii nostrii si iti dam din bani inapoi garantat

(in plus fata de orice promotie / reducere / cupon care iti sunt oferite de magazinele in cauza)

#13 Fabrice

    PrestaShop Fanatic

  • 28 Jul 2008
  • Moderators
  • 3124 posts
  • Location:Strasbourg - east France

Posted 18 September 2009 - 09:49 PM

Hi !

I am looking for another function : how may I change the decimal parameter, but ONLY on product.tpl pages ?

I am searching for that since 4 hours now, and I despair...
want to get 200,00 to 200 - so without decimals (but only in product.tpl page)

many tks in advance...
Fabrice
http://www.my-deco-shop.com
Projet en cours de lancement - New fantastic module: Checkout-Pro
le meilleur outil de gestion pour Prestashop que j'utilise - best tool I use: Store Commander

#14 ugur onur

    PrestaShop Apprentice

  • 05 Aug 2009
  • Members
  • PipPip
  • 409 posts

Posted 18 March 2010 - 01:13 PM

Thanks Radu..
===============================
5555 İletişim Hizmetleri

Referanslarımız
http://macmarketi.com (Located in Prestashop Showcase)
http://suwenshop.com
http://deryayinevi.com.tr
http://portobelloshop.com
http://alabilirsin.com
http://macdeposu.com
http://retek.com.tr (CMS designed from Prestashop)
http://miratas.com (CMS designed from Prestashop)
==============================

#15 betch

    PrestaShop Newbie

  • 05 Mar 2010
  • Members
  • Pip
  • 4 posts

Posted 08 May 2010 - 01:13 AM

thanks Radu... just what i needed for my shop

#16 ugur onur

    PrestaShop Apprentice

  • 05 Aug 2009
  • Members
  • PipPip
  • 409 posts

Posted 11 June 2010 - 03:00 PM

From 1252086220:

if you don't want to use a module make this modifications:

in init.php before:
$currency = Tools::setCurrency();

add:
$cookie->id_currency = intval(Configuration::get('PS_CURRENCY_FRONT_DEFAULT'));


in admin/tabs/AdminCurrencies.php after:
'PS_CURRENCY_DEFAULT' => array('title' => $this->l('Default currency:'), 'desc' => $this->l('The default currency used in shop'), 'cast' => 'intval', 'type' => 'select', 'identifier' => 'id_currency', 'list' => Currency::getCurrencies()),

add:
'PS_CURRENCY_FRONT_DEFAULT' => array('title' => $this->l('Default currency front:'), 'desc' => $this->l('The default currency used in front shop'), 'cast' => 'intval', 'type' => 'select', 'identifier' => 'id_currency', 'list' => Currency::getCurrencies()),


that's it! now go to admin->payment->currencies and set up your default shop currency. Customer CAN change the currency if needed.


when I use this forcecurrency module all store order email effected. For example after the shopping prestashop sending order mail correct amount to customer, but another order email which is store owner getting has a wrong amount... would you tell me how can i fix this..

Attached File(s)


===============================
5555 İletişim Hizmetleri

Referanslarımız
http://macmarketi.com (Located in Prestashop Showcase)
http://suwenshop.com
http://deryayinevi.com.tr
http://portobelloshop.com
http://alabilirsin.com
http://macdeposu.com
http://retek.com.tr (CMS designed from Prestashop)
http://miratas.com (CMS designed from Prestashop)
==============================

#17 antonescu

    PrestaShop Newbie

  • 25 Aug 2010
  • Members
  • Pip
  • 2 posts

Posted 26 August 2010 - 08:08 PM

hello Ugur Onur, do you have solved the problem with order email?

#18 ugur onur

    PrestaShop Apprentice

  • 05 Aug 2009
  • Members
  • PipPip
  • 409 posts

Posted 26 August 2010 - 09:54 PM

From 1282849712:

hello Ugur Onur, do you have solved the problem with order email?


Nope, unfortunately I could nor solve this problem... If I solve I will let you know How I did...
===============================
5555 İletişim Hizmetleri

Referanslarımız
http://macmarketi.com (Located in Prestashop Showcase)
http://suwenshop.com
http://deryayinevi.com.tr
http://portobelloshop.com
http://alabilirsin.com
http://macdeposu.com
http://retek.com.tr (CMS designed from Prestashop)
http://miratas.com (CMS designed from Prestashop)
==============================

#19 antonescu

    PrestaShop Newbie

  • 25 Aug 2010
  • Members
  • Pip
  • 2 posts

Posted 26 August 2010 - 09:59 PM

Ok, thanks for the reply. I hope we can solve this problem!





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users