Learn how to add a new country to Shopp using the Shopp countries filter. This will be added to your themes functions.php file.

How to Add a New Country using the Shopp Countries Filter

How to Add a New Country using the Shopp Countries Filter

In this tutorial we’ll go over how to add a new country to Shopp. This will be accomplished using the Shopp countries filter.

An Overview of the Shopp Countries Filter

Lets get started by viewing an example of the countries filter for Shopp:

function addCuraçao($countries) {
    $countries['CW'] = array(
        'name'=> 'Curaçao',
        'currency' => array(
        'code' => 'ANG', 
        'format' => 'ƒ#,###.##'),
        'units'=> 'metric',
        'region'=> 0);

    return $countries;
}
add_filter('shopp_countries', 'addCuraçao');

The above example is for the country of Curaçao which is located north of South America.

Note that we have given the function a unique name of “addCuraçao” — additionally the filter also references the name of the function.

Here are references for the information within the function:

  • CW = The country code for Curaçao
  • ANG = The currency code for Curaçao
  • ƒ#,###.## = The currency formatting for Curaçao
  • The units of measurement that are used in Curaçao is metric
  • Curaçao is located in the Caribbean and therefore has a region of 0

The actual information was found by running a few searches on Google. The CIA World Factbook and an online encyclopedia such as Wikipedia are two good sources to start with. If while researching, you discover that some information is conflicting, then we recommend checking several additional sources.

Applying the Shopp Countries Filter

The Shopp countries filter needs to be applied to the functions.php of the active theme.

  1. Open your preferred FTP client (FileZilla is a free option).
  2. Login to your WordPress root via SFTP or FTP.
  3. Browse to the location of your theme’s functions.php file. This is generally wp-content/themes/yourthemefolder/functions.php. If you are unsure, check with the documentation for your theme.
  4. Open the functions.php file for editing.
  5. Now enter your new filter. Another option is to copy and paste the example for Curaçao and then make edits as needed for your country.
  6. Save changes to the file.

Now go to the WordPress AdminShopp Setup. Ensure that your new country is enabled as a target market and Save Changes.

Notes

If you are currently using individual shipping rates for countries, you’ll want to also create a new shipping rate for your new country. If you are using a general shipping such as “domestic shipping” and “international shipping” — then you won’t need to make this change.

Avatar of Lorenzo Orlando Caum

By

Lorenzo Orlando Caum is the founder of Enzo12 LLC, a consultancy in Tampa, FL. Lorenzo provides consulting services such as a Shopp upgrade service through Shopp 101. He also recommends using managed WordPress hosting with Shopp because a faster site means more sales. You can learn more about Lorenzo, you can follow @lorenzocaum on Twitter or check out his blog.

You must be logged in to post a comment.

© Ingenesis Limited. Shopp™ is a registered trademark of Ingenesis Limited.

Skip to toolbar