does miva 9.8 allow mvt:assign to have indexes in the name part?
Collapse
X
-
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!!
-
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
-
In regular Miva Script, you can do this by putting a string expression in the NAME part, e.g.I guess the equivalent in Store Morph would beCode:<MvASSIGN 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.Code:<mvt:assign name="'g.array[' $ g.idx $ ']:code'" value="l.someSKU" />
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
-
-
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,
SusanSusan Petracco
NetBlazon
1.866.400.2444
_____________________________________________
Like us on Facebook
Comment
-
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
Comment