2017-11-02 21 views
0

"小" "中" "大" "大x" "xx-large" "xxx-large"のサイズ変更を自動的に名前変更する方法を見つけようとしています。 S「『M』 『L』」XL 『XXL』 ..などサイズ変更の名前を変更しました

私はサイズのバリエーションの名前を変更したい理由が原因で取り上げられている余分なスペースの量である。

私はShopifyで製品を作成する前にサイズの変種の名前を変更できないアプリから製品を作成しています。時間効率が悪いため、各製品の異形タイトルを手動で変更しても意味がありません。

私はこれを行うための最善の方法はJavascriptを使用することだと思っていますが、これを実行する方法を正確にはわからないので何も壊れません。

次は、中サイズのバリアントのHTMLソースコードの例です。見本用

<div data-value="Medium" class="swatch-element medium-swatch available"> <label for="swatch-1-medium-286472667159"> 
      Medium <span class="crossed-out"></span></label></div> 

液体源。回避策として

<div class="swatch clearfix" data-option-index="{{ option_index }}"> 
    <div class="option_title">{{ swatch }}</div> 
    {% assign values = '' %} 
    {% for variant in product.variants %} 
    {% assign value = variant.options[option_index] %} 
    {% unless values contains value %} 
     {% assign values = values | join: ',' %} 
     {% assign values = values | append: ',' | append: value %} 
     {% assign values = values | split: ',' %} 

     <input id="swatch-{{ option_index }}-{{ value | handle }}-{{ product.id }}" type="radio" name="option-{{ option_index }}" value="{{ value | escape }}"{% if forloop.first %} checked{% endif %} /> 
     <div data-value="{{ value | escape }}" class="swatch-element {% if is_color %}color {% endif %}{{ value | handle }}-swatch {% if variant.available %}available{% else %}soldout{% endif %}"> 
     {% if is_color %} 
      <div class="tooltip">{{ value }}</div> 
     {% endif %} 
     {% if is_color %} 
      <label for="swatch-{{ option_index }}-{{ value | handle }}-{{ product.id }}" style="background-image: url({{ value | handle | append: '.' | append: file_extension | asset_img_url: '50x' }}); background-color: {{ value | split: ' ' | last | handle }};"> 
      <span class="crossed-out"></span> 
      </label> 
     {% else %} 
      <label for="swatch-{{ option_index }}-{{ value | handle }}-{{ product.id }}"> 
      {{ value }} 
      <span class="crossed-out"></span> 
      </label> 
     {% endif %} 
     </div> 
    {% endunless %} 
    {% endfor %} 
</div> 

答えて

1

、私はあなたにこの方法をお勧めすることができます:エクセルにプレーンCSV

  • を開き、CSVファイルのShopifyから

    1. 輸出製品
    2. は "とExcelのすべてのサイズのバリエーションの名前を変更します検索と置換」
    3. Shopifyに再度インポートしてください(Overwrite existing products that have the same handleを選択してください)
  • 関連する問題