LoginSignup
2
0

More than 1 year has passed since last update.

Shopify|公式テーマ『Prestige』にてカラースウォッチが動作しない場合の注意点

Posted at

01. Prestigeでのカラースウォッチ機能の仕様

{%- assign color_label = 'color,colour,couleur,colore,farbe,색,色,färg,farve' | split: ',' -%}
  1. 上記コードにて『color_label』という変数にカラー関連の用語(color,色など)を事前に格納している。(assign:割り当てる
  2. 後で実際のオプション名が『color_label』内に格納されている用語とマッチするかどうかを判別する。
  3. マッチしている場合にのみカラースウォッチが動作する。

『Prestige』のカラースウォッチは上記のような仕様になっている。


02. 対応策

そのため、事前に『color_label』に格納されている用語とオプション名がマッチしない場合にはカラースウォッチが動作しない。

注意点としてはオプション名を『カラー』にした場合、デフォルトでは『カラー』という用語は『color_label』に格納されていないため、別途格納してあげる必要がある。(下記参照)

{%- assign color_label = 'color,colour,couleur,colore,farbe,색,カラー,色,färg,farve' | split: ',' -%}
2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0