Created
June 3, 2019 08:17
-
-
Save savchukoleksii/7ee5572e63a92a1f57acfdc7592fc835 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% comment %} | |
Replace all symbols that not listed in `except_symbols` | |
{% endcomment %} | |
{%- assign separator = '%%%' -%} | |
{%- assign except_symbols = '1234567890.' -%} | |
{%- assign international_shipping = settings.international_shipping -%} | |
{%- assign international_shipping_except = except_symbolds | split: '' | uniq | join: separator -%} | |
{%- assign international_shipping_except = international_shipping_except | split: separator -%} | |
{%- assign international_shipping_array = settings.international_shipping | split: "" | uniq -%} | |
{%- for international_shipping_element in international_shipping_array -%} | |
{%- unless international_shipping_except contains international_shipping_element -%} | |
{%- assign international_shipping = international_shipping | replace: international_shipping_element, '' -%} | |
{%- endunless -%} | |
{%- endfor -%} | |
{{- international_shipping -}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment