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

    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

    #2
    This covers arrays and structures:

    https://docs.miva.com/template-language/arrays

    Your own example looks correct.

    Scott
    Need to offer Shipping Insurance?
    Interactive Design Solutions https://www.myids.net
    MivaMerchant Business Partner | Certified MivaMerchant Web Developer
    Competitive Rates, Custom Modules and Integrations, Store Integration
    AutoBaskets|Advanced Waitlist Integration|Ask about Shipping Insurance Integration
    My T-shirt Collection is mostly MivaCon T-shirts!!

    Comment


      #3
      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.

      Comment


        #4
        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.
        Kent Multer
        Magic Metal Productions
        http://TheMagicM.com
        * Web developer/designer
        * E-commerce and Miva
        * Author, The Official Miva Web Scripting Book -- available on-line:
        http://www.amazon.com/exec/obidos/IS...icmetalproducA

        Comment


          #5
          edited: I"ll go try this!

          Comment


            #6
            It didn't work for me in storemorph.

            Any luck?
            http://www.alphabetsigns.com/

            Comment


              #7
              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
              Susan Petracco
              NetBlazon

              1.866.400.2444

              _____________________________________________

              Like us on Facebook

              Comment


                #8
                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?
                Kent Multer
                Magic Metal Productions
                http://TheMagicM.com
                * Web developer/designer
                * E-commerce and Miva
                * Author, The Official Miva Web Scripting Book -- available on-line:
                http://www.amazon.com/exec/obidos/IS...icmetalproducA

                Comment

                Working...
                X