Announcement
Collapse
No announcement yet.
does miva 9.8 allow mvt:assign to have indexes in the name part?
Collapse
X
-
Maybe it's me, but I don't see why this is difficult. I probably don't understand what you mean by "selected orders" and "aggregate." Why can't you just use an mvt:foreach loop? Can you give us some more details about what you're trying to accomplish?
-
Is this feature still not available?
I'd like to make a batch report that loops through the selected orders and aggregates the individual product data across those orders. I can't think of a way to do that without building an array based on the product codes, which means I need a member element (or a hack by concatenating in a variable on the name element).
Thanks,
Susan
Leave a comment:
-
In regular Miva Script, you can do this by putting a string expression in the NAME part, e.g.Code:<MvASSIGN NAME="{ 'g.array[' $ g.idx $ ']:code' }" VALUE="{ l.someSKU }">
Code:<mvt:assign name="'g.array[' $ g.idx $ ']:code'" value="l.someSKU" />
Leave a comment:
-
What I really want to do is like on those topics I linked to is like this pseudo code
g.idx = 0
foreach item of items
If true
g.idx = g.idx +1
<mvt:assign name="g.array[g.idx]:code" value="'l.somesku'" />
<mvt:assign name="g.array[g.idx]:qty" value="l.number'" />
/if
/foreach
Brennan wrote in 2015 that it was in the plans. I wonder if it made it in. I’m looking for a yes or not yet answer.
Leave a comment:
-
This covers arrays and structures:
https://docs.miva.com/template-language/arrays
Your own example looks correct.
Scott
Leave a comment:
-
does miva 9.8 allow mvt:assign to have indexes in the name part?
I know this is an old thread... but can we in miva 9.8 do the ability to use indexes in the name of the mvt:assign statement now?
like so?
<mvt:assign name="g.array[1]" value="'test'" />
referring to the old 2015 thread
https://www.miva.com/forums/forum/de...-conconcatate=
and also here
https://www.miva.com/forums/forum/de...ributes-pleaseTags: None
Leave a comment: