Answer the question
In order to leave comments, you need to log in
How to sort modx option values?
Hello. I have a store on modx revo and I created additional options set values
up to 280 cm
up to 330 cm
up to 350 cm
I set up the modifier so that it adds 330 and 350 to 1000 r to the size
, the call of the option itself did this
{'msProductOptions_ext' | snippet : [
'onlyOptions' => 'height',
'tpl' => '@INLINE
{foreach $options as $key => $option}
<div class="info-line">
<div class="label">Высота лестницы:</div>
<div class="delimetr"></div>
<div class="block-sel-size">
{if $option.value is array}
<select name="options[{$key}]">
{foreach $option.value as $i => $value}
<option value="{$value}">{$value}</option>
{/foreach}
</select>
{/if}
</div>
</div>
{/foreach}'
]}
//$modx->log(1, print_r($options, 1));
if(isset($options['extSize']['value']['luk']['height'])){
$tmpVal = $options['extSize']['value']['luk']['height'];
sort($tmpVal);
$options['extSize']['value']['luk']['height'] = $tmpVal;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question