VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product pricing => Topic started by: hannov on November 18, 2016, 11:59:30 AM

Title: Geo Location and Different Pricing per Country
Post by: hannov on November 18, 2016, 11:59:30 AM
Hi Everyone,
I am currently running Joomla 3.6.4 and VM 3.0.16.  We are only using VM as a catalogue for now.  Here is the scenario:
1. The client have individual pricing for South Africa, Namibia and Botswana NOT based on exchange rate or any fixed ratio.
2. They want to use Geolocation to display the correct pricing for each country when a customer browse the site.

This Is where we at now:
1. We are running a plugin that switches the VM currency depending on Geolocation data.  This is working 100%
2. At the moment when switched to different country/currency the default price gets coverted using fixed rate. Not what they want as each product is individually priced.
3. I created three shopper Groups:
     South Africa
     Namibia
     Botswana
4. For each product I created pricing as follows:
    Product 1 -> R100 (ZA rand; Shopper grp South Africa)
                    -> 250P (Botswana P; Shopper grp Botswana)
                    -> 450$ (Namibia $; Shopper grp Namibia)

Here is the final step I would really like some assistance with (Editing the overwrite files). At this stage the site is already switched with the plugin to the correct country/currency.
Insert some logic where Sales Price is displayed to do the following:
If currency = ZA Rand display Shopper grp South Africa price for that product.
If currency = Botswana P display Shopper grp Botswana price for that product.
If currency = Namibia $ display Shopper grp Namibia price for that product.

All of this will happen on flypage without any user logged in as we dont provide that functionality.

Hope you can help me or at least point me in the right direction. Thanks so much.


Title: Re: Geo Location and Different Pricing per Country
Post by: Studio 42 on November 20, 2016, 23:26:17 PM
Why using prices ?
have you multiple price displayed ?
The simple way is to write a customfield plugin associate to your current country plugin, if you are sure you never sold something in the shop.
You can add a product customfield  plugin too, that check country from your plugin to change price(or disable price)
Else you can add a price calculation plugin to switch selected price too.

Note: i don't tested exactly this solutions, but one of this(or all) should work
Title: Re: Geo Location and Different Pricing per Country
Post by: Milbo on November 21, 2016, 20:06:50 PM
First you should download the geolocator http://extensions.virtuemart.net/back-office/tools/geolocator-for-joomla-detail

the localiser can be extended to work as you want http://extensions.virtuemart.net/shopper-order/orders/vm-localise-detail

But I directly say it is not part of its native features. But it does this " It prefills the country to the address of your guest users. So it directly handles the shopper without being logged in correctly according to their country."

so it makes the most important part and when you take a look on the files, you see a commented part for the currencies.
Title: Re: Geo Location and Different Pricing per Country
Post by: hannov on November 23, 2016, 10:31:49 AM
Awesome tx guys.  Will have a look and update you all :)
Title: Re: Geo Location and Different Pricing per Country
Post by: hannov on December 05, 2016, 08:33:20 AM
Update: I got the geolocation working and displaying specific custom fields based on currency and country on the product details page. 
I have been looking at how to display specific custom field on the category view, but pulling my hair out grrr.  And help with how to display a specific or one custom field for each product in the category view.