L
L
lookingfor22019-12-25 15:53:15
MODX
lookingfor2, 2019-12-25 15:53:15

Why does the order of options change when the page is refreshed?

{$_modx->runSnippet("msProductOptions", [
'onlyOptions' => $parent | resource : 'options',
'product' => $id,
'tpl' => 'tpl.msProductOptions3'
])}
<-- snippet
{foreach $options as $option}
{$option.caption}:
{if $option.value is array}
{$option.value | join : ", "}
{if $option.measure_unit}
{$option.measure_unit}
{/if}
{else}
{$option.value}
{if $option.measure_unit}
{$option.measure_unit}
{/if}
{ /if}
{/foreach}
<-- chunk
Every time the page is refreshed, the order in which options are displayed changes.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2019-12-25
@Rsa97

Look not there. Show where and how the $options array is formed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question