Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Is Localization Still Supported Rate Topic   - - - - -

 
  • djhosken
  • Member
  • Members
  • Join Date: 27-Jul 12
  • 38 posts

Posted 25 October 2015 - 11:44 PM #1

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.



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11362 posts

Posted 26 October 2015 - 03:58 AM #2

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


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • djhosken
  • Member
  • Members
  • Join Date: 27-Jul 12
  • 38 posts

Posted 26 October 2015 - 04:23 AM #3

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...es/#entry224954

 



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11362 posts

Posted 26 October 2015 - 05:04 AM #4

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}

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • djhosken
  • Member
  • Members
  • Join Date: 27-Jul 12
  • 38 posts

Posted 26 October 2015 - 06:16 AM #5

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...oices/?p=233474



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11362 posts

Posted 26 October 2015 - 08:34 PM #6

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.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.