Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You do not need to change the parser. It works exactly as you would expect it to.</p> <p>The problem that you are experiencing is that product options do not have their own sku. Sku is set on an option value and in case of custom options with a single value it is saved in sku column in catalog_product_option and you can set it in getOptionValues function with</p> <pre><code>$value['class'] = $this-&gt;htmlEscape($_value-&gt;getSku()); </code></pre> <p>but in case of a dropdown or a multi-select sku is not set in that table (is set to NULL) but is instead set in catalog_product_option_type_value (one sku for each option value).</p> <p>If you would like to have all the sku-s in div with class option-box you will have to do something like this:</p> <p>In getOptionValues function:</p> <pre><code>//... $value = array(); $value[ 'skus' ] = $this-&gt;htmlEscape($option-&gt;getSku()); //... //code for select and multi-select if ($option-&gt;getGroupByType() == Mage_Catalog_Model_Product_Option::OPTION_GROUP_SELECT) { foreach ($option-&gt;getValues() as $_value) { $value[ 'skus' ] .= ' ' . $this-&gt;htmlEscape($_value-&gt;getSku()); //... </code></pre> <p>In option.phtml:</p> <pre><code>var firstStepTemplate = '&lt;div class="option-box {{skus}}" id="option_{{id}}"&gt;'+ </code></pre> <p><strong>Edit:</strong> That being said I wouldn't advise you to use sku in such a way. First of all sku can be changed (or not even exist) for option values. The second reason would be that options and option values are uniquely identified by their IDs. And the third reason would be that putting skus into class attribute (like in the example) wouldn't be the way to go (maybe adding your own data-my_attribute="{{skus}}" would be a bit better but there would still be a problem with having too many option values for a single option).</p> <p>I'd suggest that you don't change anything in option.php/.phtml (and if possible not even using your own derived class) or at least only add your class value in phtml template that you would then use in an external javascript file from where you would be able to change html structure on the fly.</p> <p>Regarding the blank page I'd say that you have made a mistake with changes to your php or javascript code and not with providing wrongly named values to template. I haven't noticed any problems no matter how I name the variables as long as they have the correct javascript variable sintax.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload