2017-11-02 4 views
0

Ich versuche, eine Möglichkeit zum automatischen Umbenennen der Größenvarianten "klein" "Mittel" "groß" "x-groß" "xx-groß" "xxx-groß", " S „‚M‘‚L‘“ XL ‚XXL‘ .. usw.Benennen Sie die Größe variante Titel in shopify

der Grund, warum ich ist es, die Größe Varianten umbenennen möchten, weil die Höhe der zusätzlichen Platz, der bis genommen wird.

I Ich erstelle Produkte aus einer App, bei der ich den Namen der Größenvarianten nicht ändern kann, bevor ich die Produkte in shopify erstelle.Es wäre nicht sinnvoll, die Variantentitel jedes Produkts manuell zu ändern, weil es nicht zeiteffizient ist.

Ich denke, der beste Weg, dies zu tun, ist mit Javascript, aber ich weiß nicht genau, wie man das macht, damit es nichts bricht.

Hier ist ein Beispiel für den HTML-Quellcode der Variante mittlerer Größe.

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

Flüssigkeitsquelle für die Muster.

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

Antwort

1

Als Abhilfe kann ich Ihnen auf diese Weise vorschlagen:

  1. Exportprodukte aus Shopify im Klar CSV
  2. öffnen CSV-Datei in Excel
  3. alle Größenvarianten in Excel umbenennen mit " Suchen und Ersetzen "
  4. Importieren Sie erneut in Shopify (stellen Sie sicher, dass Sie Overwrite existing products that have the same handle ausgewählt haben)
Verwandte Themen