This issue was solved with the help of a couple of our users who reported the error on their purchase and then continued to make test transactions for us from other locations in the world – Thank you! We really appreciate your help.
It’s been a big week completing the new template as well as the new shopping system. And for all our effort and testing we got rewarded with an unexpected Virtuemart Paypal error, Typical.
“Paypal does not allow your country of residence to ship to the country you wish to”
With much confusion and googling we discover we’re not the first to experience this error; And it’s not specific to Virtuemart. UberCart and other cart systems have also scored this error. Sandbox.paypal.com test accounts don’t produce the same results so this error isn’t discovered until the shop goes live (we’ll for all our test accounts no errors were produced. Your cart and Paypal configuration may be different). Now I can’t help a whole bunch with other systems but I did find a work around for Joomla + Virtuemart.
In our Virtuemart admin area we can select ‘store’ then ‘list payments methods’, I have Paypal as my only active payment method. In the ‘configuration’ tab we get to set some parameters for pay pal like our Paypal email. In the ‘extra info’ text area there is a bunch of PHP which pulls the users data and product info to be sent to Paypal for purchasing. It all looks dandy, until you configure Virtuemart for downloadable goods. Virtuemart 1.1.2 offers a nice revised check out to its earlier releases; We now get to skip all the billing and shipping info when we configure Virtuemart for downloads. This is good for the shopper which is always good for merchant. However in our first few lines of code in ‘extra info’ we’re still trying to pull the users ‘country code’.
$db1 = new ps_DB();
$q = “SELECT country_2_code FROM #__vm_country WHERE country_3_code='”.$user->country.”‘ ORDER BY country_2_code ASC”;
With no billing or shipping info the Virtuemart user data goes to defaults in the database. Mainly a lot NULL’s a couple of 0’s and one ‘US’ which is the default country code in the database. Lucky for us it’s easy to fix. If you look further down the PHP extra info (around line 22) you’ll find a line with “address_override” => “1”,. This is some Paypal API to help the shopper with payment when they get to Paypal. With out all the data fields this causes error, but it’s OK we don’t want the address/billing info anyway.
Change line 22 “address_override” => “1”, to “address_override” => “0”,. With this set Paypal wont try and gather all the other address information which isn’t there.
And to save 0.004 of a second we can delete the database request on the first 3 lines or comment it out.
//$db1 = new ps_DB();
//$q = “SELECT country_2_code FROM #__vm_country WHERE country_3_code='”.$user->country.”‘ ORDER BY country_2_code ASC”;