CartThrob Multi Location Manager Version 1.675

CartThrob Multi Location addon enables you to dynamically set preferences and change configurations of your CartThrob powered cart based on the customers location, or on other data that has been added to the cart.

CartThrob Multi Location is an addon for CartThrob. Like other CartThrob addons, it must be uploaded and installed on your website, and CartThrob must be active for it to run. To use this addon, you will may want to add additional template tags to use its full power You can place the tags in any of your EE templates to suit your specific workflow. Sample template code can be found here in the documentation.

Support note This module is provided at no cost. As such we provide no free support for this module. If you would like support for this module, we can bill our hourly rate for basic setup & modifications, or we can provide a quote for more extensive modifications.

Features

  • Set multiple price fields, one for each country or region
  • Change pricing prefixes ($, £, €) dynamically
  • Change decimal separator (. or ,)
  • Change currency code (USD, CAD, AUD, GBP, EUR, etc)
  • Change tax and shipping plugins on the fly
  • Change many other low-level CartThrob (control member data saving, session length, global coupon limit) configurations
  • Dynamically changes configurations based on customer locations or other custom data.
  • Uses EE's IP to Nation module to determine customer location (if there is no store-wide default location set)

Requirements

  • ExpressionEngine 2.5+
  • CartThrob 2.2+
  • PHP 5.3+

Installation

  • Upload the /system/expressionengine/third_party/cartthrob_multi_location/ folder to /system/expressionengine/third_party/
  • Make sure Extensions are enabled on your system
  • Install the CartThrob Multi Location module and extension (through EE's add-ons/modules panel)

Upgrading

  • Upload the /system/expressionengine/third_party/cartthrob_multi_location/ folder to /system/expressionengine/third_party/ Overwriting existing files.
  • Go to EE settings » addons » and click "Run Module Updates"

Settings

The settings are broken up into 4 discrete sections.

  1. Choose whether billing or shipping address should be used to change configuration options
  2. Set price & shipping fields
  3. Set currency formatting, shipping & tax plugin based on location
  4. Change configurations based on location

In each case, the settings are cascading. The first rule that matches will be used. So, if you want to make changes for the United Kingdome, Europe and also set global defaults, you'd need to set settings for:

  1. United Kingdom
  2. Europe
  3. GLOBAL

If you reversed these and had GLOBAL evaluated first, both United Kingdom and Europe would never match, because your GLOBAL rate would always match. The settings cascade from top to bottom, so set your settings from most to least specific, top to bottom.

Notes For the most part this addon changes configurations based on the customers country code, and not on the selected currency, zip code, state or region. If you require these features feel free to contact us to request a custom modification.

CartThrob Multi Location Manager Settings CartThrob Multi Location Manager.

Advanced

You can change CartThob configuration settings as well based on custom data set in the cart. For instance, you can capture custom data (in this case a region) like this:

{exp:cartthrob:save_customer_info_form return=""}

    <input type="text" value="WESTERN" name="custom_data[region]" /> 

    <input type="submit" name="Submit" /> 
{/exp:cartthrob:save_customer_info_form}

You could then change the shipping_plugin based on a region change.

Using IP to Nation

If you want to use ip2nation to help idenfity a customer's country of origin before they've self-identified by saving their location, you can use IP to Nation module provided by ExpressionEngine. To use this, primarily, you need to

  1. Set up IP to Nation module
  2. Make sure that in CartThrob » Global Settings » Default Location does not have a shipping or billing country code. If a billing or country code is set as a default the IP to Nation module will not be used, and the default will instead be assumed to be the customer's location.

Tags

For the most part the Multi Location manager is something that requires configuration only, but there are a few template tags you can use to provide custom messaging to your customer

check_location

Outputs a custom message when the customer's location has been updated. This is useful if you need to explain a difference in taxing or shipping prices.

message
message='Prices have been updated based on your new location'
Example
{exp:cartthrob:check_location message='Location, Taxes & Shipping has been updated'}

configured_price

Outputs an item's price based on the configured price field. If you have three price fields this will always show the price from the field that is currently set. This is only needed when outputting content from a channel:entries tag. All CartThrob tags will output the currently configured price

entry_id
entry_id="123"
Example
{exp:cartthrob:configured_price entry_id="123"}

configured_shipping

This tag is only needed if you have multiple shipping fields set per item in its channel:entry. If you use any configured shipping plugin like Per location quantity threshold this is not necessary. Like the configured_price tag, this outputs an item's shipping based on the configured shipping field. If you have three shipping fields this will always show the shipping amount from the field that is currently set.

{exp:cartthrob:configured_shipping entry_id="123"}