Announcement

Collapse
No announcement yet.

does miva 9.8 allow mvt:assign to have indexes in the name part?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Kent Multer
    replied
    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?

    Leave a comment:


  • netblazon
    replied
    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:


  • alphabet
    replied
    It didn't work for me in storemorph.

    Any luck?

    Leave a comment:


  • kayakbabe
    replied
    edited: I"ll go try this!

    Leave a comment:


  • Kent Multer
    replied
    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 }">
    I guess the equivalent in Store Morph would be
    Code:
    <mvt:assign name="'g.array[' $ g.idx $ ']:code'" value="l.someSKU" />
    But I haven't tried it myself; I don't know if Store Morph allows expressions in the name part.

    Leave a comment:


  • kayakbabe
    replied
    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:


  • ids
    replied
    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-please
Working...
X