Author Topic: How To Set Different Currency Per Product Groups  (Read 158 times)

orbeyiosx

  • Beginner
  • *
  • Posts: 4
  • A beginner
How To Set Different Currency Per Product Groups
« on: September 12, 2018, 17:02:14 pm »
Hi,

What i want to achieve is, i want to use a different currency for a product group.
I tried to create multivendor but i cannot managed to change default Currency of new vendor.

We created store as one vendor with one currency (TRY)
But some products needs to displayed as USD

So in order to do that i tried to convert store to multi vendor,
I have managed to set second vendor but whenever i change the main vendor (Store Owner) currency other vendor default currencies changes.

Would you please tell me how can i achieve this.
Here is the details of my installation;
VirtueMart 3.2.12
PHP Version   7.2.9
Web Server   Apache
WebServer to PHP Interface   fpm-fcgi
Joomla! Version   Joomla! 3.8.12 Stable [ Amani ] 28-August-2018 14:00 GMT

orbeyiosx

  • Beginner
  • *
  • Posts: 4
  • A beginner
Re: How To Set Different Currency Per Product Groups
« Reply #1 on: September 13, 2018, 08:35:21 am »
Basically my question; Is it possible to use two different currencies on a website?

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 8002
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.14
Re: How To Set Different Currency Per Product Groups
« Reply #2 on: September 13, 2018, 09:51:08 am »
There is a hidden setting  - price per currency

https://docs.virtuemart.net/manual/general-concepts/206-hidden-configurations.html

pricesbyCurrency

this then allows u to set a price in different currencies per product

you then need to figure out some way to only display the one you want
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

orbeyiosx

  • Beginner
  • *
  • Posts: 4
  • A beginner
Re: How To Set Different Currency Per Product Groups
« Reply #3 on: September 13, 2018, 17:00:30 pm »
Hi Dear GJC Web Design,

You have shared a perfect piece of information, thanks a lot for that.

I have just edited config file. I uncommented pricesbyCurrency and saved configuration and changed the price currency to euro for a product.
But when i go to check the product product it still displays as TL

I reverted back to single vendor option again. But nothing changed. Am i doing something missing?



There is a hidden setting  - price per currency

https://docs.virtuemart.net/manual/general-concepts/206-hidden-configurations.html

pricesbyCurrency

this then allows u to set a price in different currencies per product

you then need to figure out some way to only display the one you want

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 8002
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.14
Re: How To Set Different Currency Per Product Groups
« Reply #4 on: September 13, 2018, 17:29:32 pm »
It only displays in € if the selected currency is € ( e.g. if u had the VM currency selector published and u chose €)

As I said -- u will need to figure out HOW to display the products with e.g. ONLY a € price in euros

from memory it is only a url param .. I think &virtuemart_currency_id=[currency_id]

so u need prob. to append that to the cat and product urls that need to display in € or at least play with the UserStates maybe

e.g.

$app->setUserState('virtuemart_currency_id', $c_int);
      $app->setUserState('com_virtuemart.virtuemart_currency_id', $c_int);

There could of course be a simpler way...  maybe somebody knows
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

orbeyiosx

  • Beginner
  • *
  • Posts: 4
  • A beginner
Re: How To Set Different Currency Per Product Groups
« Reply #5 on: September 15, 2018, 01:26:42 am »


e.g.

$app->setUserState('virtuemart_currency_id', $c_int);
      $app->setUserState('com_virtuemart.virtuemart_currency_id', $c_int);

There could of course be a simpler way...  maybe somebody knows

It makes sense i will try but the which file i should edit?


GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 8002
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.14
Re: How To Set Different Currency Per Product Groups
« Reply #6 on: September 15, 2018, 11:23:20 am »
You have to suck and see.. this is raw dev...  probably enough in the template files but personally I would dev a system plugin

if vmcatid  in_array(xx,xxx,xxx) then change currency to y

What your wanting to do is not simple

u need ( prob) to change the UserState, the request var and maybe a JS var
publish the vm currency module to get an idea of how it works
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation