0

I like to use the plain-size data as a text swatch in the size attribute.

enter image description here

This size data is available in the admin fields. We have too many articles to enter the swatch data manually.

I know there are some similar questions and answers. Those answers are based on unique codes and scripts. [ I have little knowledge or experience in that ] I wonder, are there other options?

  • Option check marks like "Use size data as swatch data"
  • Import a CSV, linking size data to text swatch data
  • Leaving a comparison table in some folder
1
  • just to understand better. let's take as example the third row (1.5 cm). you want to copy the value 1.5 cm to the next 2 inputs? just like you have for the first 2 rows?
    – Marius
    Jul 20 at 8:09

1 Answer 1

0

In case I understood the question correctly and you want to copy the values from the admin description to the default store view swatch and description, you can just run these 2 lines in the console of your browser and then save the attribute.

Run them in this order.

jQuery("[name^=swatchtext\\[value\\]][name$=\\[1\\]]").each(function () {jQuery(this).val(jQuery(this).parent().prev().find('input').val())});
jQuery("[name^=optiontext\\[value\\]][name$=\\[1\\]]").each(function () {jQuery(this).val(jQuery(this).parent().prev().find('input').val())});

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.