/* WP-Cache Config Sample File See wp-cache.php for author details. */ $wpsc_last_post_update = 1507500483; //Added by WP-Cache Manager $wp_cache_slash_check = 1; //Added by WP-Cache Manager if ( ! defined('WPCACHEHOME') ) define( 'WPCACHEHOME', WP_CONTENT_DIR . "/plugins/wp-super-cache/" ); //Added by WP-Cache Manager $cache_compression = 1; //Added by WP-Cache Manager $cache_enabled = true; //Added by WP-Cache Manager $super_cache_enabled = true; //Added by WP-Cache Manager $cache_max_time = 600; //Added by WP-Cache Manager //$use_flock = true; // Set it true or false if you know what to use $cache_path = WP_CONTENT_DIR . '/cache/'; $file_prefix = 'wp-cache-'; // We want to be able to identify each blog in a WordPress MU install $blogcacheid = ''; if( defined( 'VHOST' ) ) { $blogcacheid = 'blog'; // main blog if( constant( 'VHOST' ) == 'yes' ) { $blogcacheid = $_SERVER['HTTP_HOST']; } else { $request_uri = preg_replace('/[ <>\'\"\r\n\t\(\)]/', '', str_replace( '..', '', $_SERVER['REQUEST_URI'] ) ); if( strpos( $request_uri, '/', 1 ) ) { if( $base == '/' ) { $blogcacheid = substr( $request_uri, 1, strpos( $request_uri, '/', 1 ) - 1 ); } else { $blogcacheid = str_replace( $base, '', $request_uri ); $blogcacheid = substr( $blogcacheid, 0, strpos( $blogcacheid, '/', 1 ) ); } if ( '/' == substr($blogcacheid, -1)) $blogcacheid = substr($blogcacheid, 0, -1); } $blogcacheid = str_replace( '/', '', $blogcacheid ); } } // Array of files that have 'wp-' but should still be cached $cache_acceptable_files = array( 'wp-comments-popup.php', 'wp-links-opml.php', 'wp-locations.php' ); $cache_rejected_uri = array('wp-.*\\.php', 'index\\.php'); $cache_rejected_user_agent = array ( 0 => 'bot', 1 => 'ia_archive', 2 => 'slurp', 3 => 'crawl', 4 => 'spider', 5 => 'Yandex' ); $cache_rebuild_files = 1; //Added by WP-Cache Manager // Disable the file locking system. // If you are experiencing problems with clearing or creating cache files // uncommenting this may help. $wp_cache_shutdown_gc = 0; $wp_super_cache_late_init = 0; // uncomment the next line to enable advanced debugging features $wp_super_cache_advanced_debug = 0; $wp_super_cache_front_page_text = ''; $wp_super_cache_front_page_clear = 0; $wp_super_cache_front_page_check = 0; $wp_super_cache_front_page_notification = '0'; $wp_cache_object_cache = 0; //Added by WP-Cache Manager $wp_cache_anon_only = 0; $wp_supercache_cache_list = 0; //Added by WP-Cache Manager $wp_cache_debug_to_file = 0; $wp_super_cache_debug = 0; $wp_cache_debug_level = 5; $wp_cache_debug_ip = ''; $wp_cache_debug_log = ''; $wp_cache_debug_email = ''; $wp_cache_pages[ "search" ] = 0; $wp_cache_pages[ "feed" ] = 0; $wp_cache_pages[ "category" ] = 0; $wp_cache_pages[ "home" ] = 0; $wp_cache_pages[ "frontpage" ] = 0; $wp_cache_pages[ "tag" ] = 0; $wp_cache_pages[ "archives" ] = 0; $wp_cache_pages[ "pages" ] = 0; $wp_cache_pages[ "single" ] = 0; $wp_cache_hide_donation = 0; $wp_cache_not_logged_in = 0; //Added by WP-Cache Manager $wp_cache_clear_on_post_edit = 1; //Added by WP-Cache Manager $wp_cache_hello_world = 0; //Added by WP-Cache Manager $wp_cache_mobile_enabled = 0; //Added by WP-Cache Manager $wp_cache_cron_check = 1; //Added by WP-Cache Manager ?> /* WP-Cache Config Sample File See wp-cache.php for author details. */ $wpsc_last_post_update = 1507500483; //Added by WP-Cache Manager $wp_cache_slash_check = 1; //Added by WP-Cache Manager if ( ! defined('WPCACHEHOME') ) define( 'WPCACHEHOME', WP_CONTENT_DIR . "/plugins/wp-super-cache/" ); //Added by WP-Cache Manager $cache_compression = 1; //Added by WP-Cache Manager $cache_enabled = true; //Added by WP-Cache Manager $super_cache_enabled = true; //Added by WP-Cache Manager $cache_max_time = 600; //Added by WP-Cache Manager //$use_flock = true; // Set it true or false if you know what to use $cache_path = WP_CONTENT_DIR . '/cache/'; $file_prefix = 'wp-cache-'; // We want to be able to identify each blog in a WordPress MU install $blogcacheid = ''; if( defined( 'VHOST' ) ) { $blogcacheid = 'blog'; // main blog if( constant( 'VHOST' ) == 'yes' ) { $blogcacheid = $_SERVER['HTTP_HOST']; } else { $request_uri = preg_replace('/[ <>\'\"\r\n\t\(\)]/', '', str_replace( '..', '', $_SERVER['REQUEST_URI'] ) ); if( strpos( $request_uri, '/', 1 ) ) { if( $base == '/' ) { $blogcacheid = substr( $request_uri, 1, strpos( $request_uri, '/', 1 ) - 1 ); } else { $blogcacheid = str_replace( $base, '', $request_uri ); $blogcacheid = substr( $blogcacheid, 0, strpos( $blogcacheid, '/', 1 ) ); } if ( '/' == substr($blogcacheid, -1)) $blogcacheid = substr($blogcacheid, 0, -1); } $blogcacheid = str_replace( '/', '', $blogcacheid ); } } // Array of files that have 'wp-' but should still be cached $cache_acceptable_files = array( 'wp-comments-popup.php', 'wp-links-opml.php', 'wp-locations.php' ); $cache_rejected_uri = array('wp-.*\\.php', 'index\\.php'); $cache_rejected_user_agent = array ( 0 => 'bot', 1 => 'ia_archive', 2 => 'slurp', 3 => 'crawl', 4 => 'spider', 5 => 'Yandex' ); $cache_rebuild_files = 1; //Added by WP-Cache Manager // Disable the file locking system. // If you are experiencing problems with clearing or creating cache files // uncommenting this may help. $wp_cache_shutdown_gc = 0; $wp_super_cache_late_init = 0; // uncomment the next line to enable advanced debugging features $wp_super_cache_advanced_debug = 0; $wp_super_cache_front_page_text = ''; $wp_super_cache_front_page_clear = 0; $wp_super_cache_front_page_check = 0; $wp_super_cache_front_page_notification = '0'; $wp_cache_object_cache = 0; //Added by WP-Cache Manager $wp_cache_anon_only = 0; $wp_supercache_cache_list = 0; //Added by WP-Cache Manager $wp_cache_debug_to_file = 0; $wp_super_cache_debug = 0; $wp_cache_debug_level = 5; $wp_cache_debug_ip = ''; $wp_cache_debug_log = ''; $wp_cache_debug_email = ''; $wp_cache_pages[ "search" ] = 0; $wp_cache_pages[ "feed" ] = 0; $wp_cache_pages[ "category" ] = 0; $wp_cache_pages[ "home" ] = 0; $wp_cache_pages[ "frontpage" ] = 0; $wp_cache_pages[ "tag" ] = 0; $wp_cache_pages[ "archives" ] = 0; $wp_cache_pages[ "pages" ] = 0; $wp_cache_pages[ "single" ] = 0; $wp_cache_hide_donation = 0; $wp_cache_not_logged_in = 0; //Added by WP-Cache Manager $wp_cache_clear_on_post_edit = 1; //Added by WP-Cache Manager $wp_cache_hello_world = 0; //Added by WP-Cache Manager $wp_cache_mobile_enabled = 0; //Added by WP-Cache Manager $wp_cache_cron_check = 1; //Added by WP-Cache Manager ?> Paypal Not Allowing Your Counrty Of Residence With Downloadable Products | Joomla Bear Blog Paypal Not Allowing Your Counrty Of Residence With Downloadable Products – Joomla Bear Blog

Paypal Not Allowing Your Counrty Of Residence With Downloadable Products

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’.

Virtuemart's Paypal Payment Method
Virtuemart

$db1 = new ps_DB();
$q = “SELECT country_2_code FROM #__vm_country WHERE country_3_code='”.$user->country.”‘ ORDER BY country_2_code ASC”;
$db1->query($q);

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.

To resolve:

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”;
//$db1->query($q);

6 Comments

 Add your comment
  1. I only changed the value from “1” to “0”.It is enough to skip the shiping error , or do i have to delete the first 3 lines as well.

    Thank you for this post…since i have the same problem.

  2. My colleague solved this one and he won’t be online for another 12 hours to confirm this but I believe the 3 lines of code can optionally be removed to increase efficiency.
    Try commenting them out so you can bring them back if it causes any issues.

  3. Thanks for this info. Worked just fine.
    Will this cause issues when I also have products that do ship out to people? At the moment they are all virtual, but that might change at some point.

    Regards,
    Jonathan

  4. Hey there, just wanted to let everyone know that I tried commenting out the first three lines as suggested and I got a PHP joomla database error. I un-commented them restoring them to original and it worked like a charm. So if you comment them and it doesn’t work, try restoring them and setting the address line to “0” and it should work.

    Thanks!

  5. Hello,

    Thank you for your tip!
    Indeed, you may receive a database error if you also remove the database query.

    To fix it, simply replace:
    “country” => $dbl->f(“country_2_code”),
    with
    “country” => “”,

    ..found a little bit lower.

    Warm regards!

  6. Thanks for this.

    You have saved my life.

Leave a Comment

Your email address will not be published.