WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.6 is now available!


Will it continue with WB? It goes on! | Geht es mit WB weiter? Es geht weiter!
https://forum.websitebaker.org/index.php/topic,32340.msg226702.html#msg226702


The forum email address board@websitebaker.org is working again
https://forum.websitebaker.org/index.php/topic,32358.0.html


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Bakery Shop »
  • Exchange rate in Bakery
  • Print
Pages: [1]   Go Down

Author Topic: Exchange rate in Bakery  (Read 6927 times)

Offline svsanchez

  • Posts: 589
Exchange rate in Bakery
« on: April 16, 2013, 02:57:24 AM »
Hello, this is an idea for a future version of Bakery, it would be great to have the option of entering an exchange rate so that products can be shown in a local currency and passed to Paypal in a Paypal-accepted currency (Paypal only accepts a bunch of currencies). So if I am in Guatemala I can fill my Bakery shop with prices in dollars, tell Bakery what the Dollar / Quetzal exchange rate is and show my visitors the price in Quetzals but send the price in US Dollars to Paypal (Quetzal is NOT accepted by Paypal). This would be of great help for most south american, african and asian bakery shops.

For those who need to show their prices in a local currency and send the amount to paypal in a paypal-accepted currency, what I did was:

1. Set the bakery shop currency as the paypal-accepted currency (for example USD)
2. Set the price in the paypal-accepted currency (for example USD 100)
3. Use one of the three extra fields and call it your local currency (for example Price in GTQ) and fill each product with the local price there. Since there is no way of using exchange rates at the moment you will have to do this one product at a time.
4. Edit the page settings for your Bakery shop to show your local currency price instead of the paypal-accepted currency price. Optional: you can put in parenthesis the price in the paypal-accepted price, for example Price: Q800 (US $100)
5. Presto!

If someone knows a better way of doing this please let me know as this solution ain't a good one for Bakery stores in countries with continued devaluations.
Logged

Offline Ruud

  • Posts: 3671
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: Exchange rate in Bakery
« Reply #1 on: April 16, 2013, 10:32:19 AM »
You can fix this by using a droplet.

In the bakery output templateblocks you could call a droplet like this.
Code: [Select]
[TXT_PRICE]: [CURRENCY] [PRICE]  ([[usd?p=[PRICE]]])
The droplet part is: [[usd?p=[PRICE]]]
This will call a droplet called USD with as parameter the current price field content.

Create a droplet (in this case called USD )
Code: [Select]
<?php

if (!isset($p)) return true;
$rate = 1.3075;
return 
"USD: ".round(($p * $rate),2);

Now you can change the rate daily on a single place.

The ouput of the example above will be:
Price: EUR 100.00 (USD: 130.75)
Logged
Dev4me - WebsiteBaker modules - WBhelp.org

Offline svsanchez

  • Posts: 589
Re: Exchange rate in Bakery
« Reply #2 on: April 17, 2013, 04:08:15 AM »
WOW, that is just amazing! Thank you Ruud, I never thought this would be possible as of now, too bad I didn't ask about this before!!!
Logged

Offline svsanchez

  • Posts: 589
Re: Exchange rate in Bakery
« Reply #3 on: May 21, 2013, 07:23:54 AM »
Ok, so this solution is amazing but I messed up ugly: I uploaded all the products (about 500) with the local currency (GTQ), then applied the droplet and everything shows fine. But then I tried placing an order with Paypal and they don't accept payments in GTQ!!! I have to send the price in USD (or any other accepted currency) to Paypal in order to accept payments. I was trying to figure out how to send to Paypal the converted amount but then it occurred to me that I could probably tell the DB to change all the prices with a formula. Is this possible? I need to divide all my prices in the DB by 7.85 (US $1 = GTQ 7.85)
Logged

Offline Ruud

  • Posts: 3671
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: Exchange rate in Bakery
« Reply #4 on: May 21, 2013, 10:29:47 AM »
If you have access to phpMyAdmin you could execute a query to change all prices.
I would advice to create a database export first so you can roll back if something goes wrong.

The items table has the price information. The query to change them would be:
Code: [Select]
UPDATE mod_bakery_items set price = (price / 7.85);where "mod_bakery_items" is the table name when you are not using a table prefix.

If you are using attributes with different prices you will need to set thos too:
Code: [Select]
UPDATE mod_bakery_item_attributes set price = (price / 7.85);
Since you will be accessing the database directly.. be carefull and only do this if you are comfortable with using phpMyAdmin. If not, you better spend the time to manually change all items!
Logged
Dev4me - WebsiteBaker modules - WBhelp.org

Offline svsanchez

  • Posts: 589
Re: Exchange rate in Bakery
« Reply #5 on: May 21, 2013, 04:22:36 PM »
Hello Ruud, thank you so much, that did it!  :-D
Logged

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Bakery Shop »
  • Exchange rate in Bakery
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2