Is Localization Still Supported

Hi, I am upgrading my store. Used localization in previous version to show selected banners in some countries, and not others. For example, when customer is from Australia, will ship "Free shipping above AUD50" and other banners. Seems like localization is however not supported any more? Is this correct?

Seems like can still enable it in "config.local.php" file. Can someone please let me know if I should use this feature, or will it be completely removed in future releases? I works really great for current version 4.1.5, and I use it for all sorts of stuff. Showing banners, price with GST for Australian customers and other stuff.

There is a template variable initialized if not using the free version. So you should have {$localization} set in all templates that will tell you what localization (if any) is set. All localizations are in the template variable {$localizations}. Weight unit, weight symbol are also available in {$config.localization.weight_symbol} and {$config.localiation.weight_unit}.

Thanks for reply! I would like to know if it is wise using it for new developments though? In this official CS Cart post from 2016/06, Imac from CS Cart replied:

This is depricated feature in CS-Cart.
We recommend use storefronts instead of localizations.

See this post

http://forum.cs-cart.com/topic/41279-localization-where-to-set-it-on-the-single-pages/#entry224954

Don't know about the past, but localizaitons are supported.

But it seems what you really want is evaluate conditions based on the country_code of the IP address.

If it were me, I'd use the fill_auth hook to get the IP country code of the user's IP address (once per session) and then reference it in template variables as {$auth.ip_country_code} to do the conditioning you want. I.e. (** NOT TESTED **)

Use the fill_auth hook:

function fn_my_changes_fill_auth(&$auth, $area) {
  if( $area == 'C' && empty($auth['ip_country_code']) && !empty($auth['ip_address'])) { // customer area, not already set and ip_address exists
    $code = @fn_get_country_by_ip(ip2long($auth['ip_address']);
    $auth['ip_country_code'] = $code;
  }
}

And in your template:

{if $auth.ip_country_code == 'FR'}
  do my French code
{elseif $auth.ip_country_code == 'UK'}
  do my British code
{else}
 do my default code
{/if}

Thanks, that looks like a great idea! Do you also do custom addon development? I just send you a message via your web site's contact us page regarding a custom addon to fix this problem:

http://forum.cs-cart.com/topic/31823-changing-currency-rate-changes-old-order-invoices/?p=233474

Yes we do and I've responded to your message.

As stated, that particular issue will require core file changes to address (I.e. ability to store and pass an pre-existing rate) and needs to be done somewhat carefully so as not to impact other areas of the system.