Okay so I am trying to add a custom field to disable specific options (we have some options that are occasionally out of stock). I got it working with one value but having a problem with my understanding of either SplitString or Multi-Text.
I created a product customfield 'prod_DisableOptions' of type Multi-Text which I understood would take one value per line and which would be separated by a '|' behind the scenes? When I add one value to the customfield via the product page it correctly disables the product but if I add a second value on a new line in the Multi-Text field then the code is not added.
All I am trying to do is take this css
which I was able to use to disable this specific option via product page. I thought I'd use a custom field in case there are more than one option on the page and to make it easier to use. Not system critical just thought it would be fun to try since boss is traveling and I have an unexpected few hours.
I created a product customfield 'prod_DisableOptions' of type Multi-Text which I understood would take one value per line and which would be separated by a '|' behind the scenes? When I add one value to the customfield via the product page it correctly disables the product but if I add a second value on a new line in the Multi-Text field then the code is not added.
All I am trying to do is take this css
Code:
<style> label[for=l-280005-0000] { pointer-events: none; opacity: 0.5; } </style>
Code:
<mvt:comment> 8/5/2021: code to add css that disables specified options </mvt:comment> <mvt:item name="customfields" param="Read_Product_Code(l.settings:product:code, 'prod_DisableOptions', g.prod_DisableOptions)" /> <mvt:if expr="NOT ISNULL l.settings:product:customfield_values:customfields :prod_DisableOptions"> <mvt:comment> open css rule and split</mvt:comment> label[for= <mvt:do file="g.Module_Library_Utilities" name="l.success" value="SplitString(g.prod_DisableOptions, '|', l.settings:aDisabledOptions)" /> <mvt:foreach iterator="string" array="aDisabledOptions"> &mvt:global:prod_DisableOptions; </mvt:foreach> <mvt:comment> close css rule </mvt:comment> ] { pointer-events: none; opacity: 0.5; } </mvt:if>
Comment