"array" Snippets


Updating order array order_status from Pending to In Progress

Simply changes any order_Status that is "Pending" to "In Progress"
Created: 1498090111
View "Updating order array order_status from Pending to In Progress"
<mvt:comment> | | By http://www.scotsscripts.com | </mvt:comment> <mvt:assign name="l.settings:order[1]:id" value="'1'" /> <mvt:assign name="l.settings:order[1]:order_status" value="'In Progress'" /> <mvt:assign name="l.settings:order[2]:id" value="'2'" /> <mvt:assign name="l.settings:order[2]:order_status" value="'In Progress'" /> <mvt:assign name="l.settings:order[3]:id" value="'3'" /> <mvt:assign name="l.settings:order[3]:order_status" value="'Pending'" /> <mvt:assign name="l.settings:order[4]:id" value="'4'" /> <mvt:assign name="l.settings:order[4]:order_status" value="'In Progress'" /> <p><b>Original:</b></p> <mvt:foreach iterator="item" array="order"> id: &mvt:item:id; status: &mvt:item:order_status;<br> </mvt:foreach> <mvt:assign name="l.elements" value="miva_array_elements(l.settings:order)" /> <mvt:while expr="l.counter LT l.elements"> <mvt:assign name="l.counter" value="l.counter + 1" /> <mvt:assign name="l.struct" value="l.settings:order[l.counter]" /> <mvt:if expr="tolower(l.struct:order_status) EQ 'pending'"> <mvt:assign name="l.struct:order_status" value="'In Progress'" /> </mvt:if> <mvt:assign name="l.success" value="miva_array_insert( l.settings:temp_array, l.struct, -1 )" /> </mvt:while> <mvt:assign name="l.settings:order" value="l.settings:temp_array" /> <p><b>Updated:</b></p> <mvt:foreach iterator="item" array="order"> id: &mvt:item:id; status: &mvt:item:order_status;<br> </mvt:foreach>
 
View "miva_array_delete() within mvt:foreach"
<h1>miva_array_delete() within mvt:foreach</h1> <mvt:assign name="l.settings:example:list[1]" value="'Bananas'" /> <mvt:assign name="l.settings:example:list[2]" value="'Milk'" /> <mvt:assign name="l.settings:example:list[3]" value="'Bread'" /> <mvt:assign name="l.settings:example:list[4]" value="'Cereal'" /> <h4>Before:</h4> <mvt:eval expr="decodeattribute(glosub(miva_array_serialize(l.settings:example), ',', '<br>'))" /> <mvt:foreach iterator="item" array="example:list"> <mvt:if expr="l.settings:item EQ 'Milk'"> <mvt:assign name="l.result" value="miva_array_delete( l.settings:example:list, l.POS1, 1 )" /> </mvt:if> </mvt:foreach> <h4>After:</h4> <mvt:eval expr="decodeattribute(glosub(miva_array_serialize(l.settings:example), ',', '<br>'))" />
 

Basket #47914

Created: 1497900663
View "Basket #47914"
<div class="column whole cart-contents"> <div class="row all-hidden medium-all-shown basket-header-row"> <div class="column one-eighth">Order #</div> <div class="column one-eighth">Order Date</div> <div class="column one-eighth align-right">Order Total</div> <div class="column one-fourth">Order Status</div> <div class="column three-eighths">Shipments</div> </div> <mvt:foreach iterator="order" array="orders"> <mvt:assign name="l.settings:list[1]" value="'Order #'" /> <mvt:assign name="l.settings:list[2]" value="'Order Date'" /> <mvt:assign name="l.settings:list[3]" value="'Shipment'" /> <mvt:do file="g.module_library_utilities" name="l.null" value="QuickSortArray(l.settings:list, '', -1)" /> <div class="row basket-product-row"> <div class="column half medium-one-eighth"><strong class="medium-all-hidden">Order # </strong>&mvt:order:id;</div> <div class="column half medium-one-eighth"><strong class="medium-all-hidden">Date: </strong>&mvt:order:date_formatted;-1</div> <div class="column half medium-one-eighth medium-align-right"><strong class="medium-all-hidden">Total: </strong>&mvt:order:formatted_total;</div> <div class="column half medium-one-fourth"><strong class="medium-all-hidden">Status: </strong>&mvt:order:order_status;</div> <div class="column three-fourths medium-one-fourth"> <strong class="medium-all-hidden">Shipments: </strong> <mvt:foreach iterator="shipment" array="order:shipments"> &mvt:shipment:tracklink;<br /> </mvt:foreach> </div> <div class="column one-fourth medium-one-eighth align-center"><a href="&mvt:global:secure_sessionurl;Screen=ORDS&amp;Store_Code=&mvta:global:Store_Code;&amp;SortBy=&mvta:global:SortBy;&amp;Offset=&mvta:global:Offset;&amp;Order_ID=&mvt:order:id;&amp;Order_BillEmail=&mvte:global:Order_BillEmail;&amp;Order_BillZip=&mvte:global:Order_BillZip;" class="button button-mini bg-gray charcoal uppercase">View</a></div> </div> </mvt:foreach> </div> <mvt:if expr="(g.Offset OR g.NextOffset) AND (l.settings:orderhistory_list:per_page NE 0)"> <mvt:if expr="g.Offset EQ 0"> <div class="column half">&nbsp;</div> <mvt:else> <form method="post" action="&mvt:global:secure_sessionurl;" class="column half"> <input type="hidden" name="Screen" value="&mvte:global:Screen;" /> <input type="hidden" name="Store_Code" value="&mvte:global:Store_Code;" /> <input type="hidden" name="SortBy" value="&mvte:global:SortBy;" /> <input type="hidden" name="Order_BillEmail" value="&mvte:global:Order_BillEmail;" /> <input type="hidden" name="Order_BillZip" value="&mvte:global:Order_BillZip;" /> <input type="hidden" name="Offset" value="&mvte:global:PrevOffset;" /> <mvt:item name="buttons" param="Previous" /> </form> </mvt:if> <mvt:if expr="g.NextOffset EQ 0"> <div class="column half">&nbsp;</div> <mvt:else> <form method="post" action="&mvt:global:secure_sessionurl;" class="column half align-right"> <input type="hidden" name="Screen" value="&mvte:global:Screen;" /> <input type="hidden" name="Store_Code" value="&mvte:global:Store_Code;" /> <input type="hidden" name="SortBy" value="&mvte:global:SortBy;" /> <input type="hidden" name="Order_BillEmail" value="&mvte:global:Order_BillEmail;" /> <input type="hidden" name="Order_BillZip" value="&mvte:global:Order_BillZip;" /> <input type="hidden" name="Offset" value="&mvte:global:NextOffset;" /> <mvt:item name="buttons" param="Next" /> </form> </mvt:if> </mvt:if>
 
View "Basket #47284"
<mvt:assign name="l.settings:attributes[1]:template_code" value="'size'" /> <mvt:assign name="l.settings:attributes[1]:prompt" value="'Select a Size:'" /> <mvt:assign name="l.settings:attributes[2]:template_code" value="'color'" /> <mvt:assign name="l.settings:attributes[2]:prompt" value="'Select a Color:'" /> <mvt:assign name="l.settings:attributes[3]:template_code" value="'foo'" /> <mvt:assign name="l.settings:attributes[3]:prompt" value="'Foo Bar:'" /> <mvt:assign name="l.settings:attributes[4]:template_code" value="'baz'" /> <mvt:assign name="l.settings:attributes[4]:prompt" value="'Baz!:'" /> <mvt:assign name="g.var" value="'color'" /> POS: <mvt:eval expr="miva_array_search( l.settings:attributes, 1, l.attribute, 'l.attribute:template_code EQ \'' $ g.var $ '\'' )" /> <mvt:eval expr="l.attribute"/>
 
View "Miva Template Language New Array and Sort Example"
<mvt:comment> | | By http://www.scotsscripts.com | </mvt:comment> <mvt:assign name="l.settings:list[1]:name" value="'apples'" /> <mvt:assign name="l.settings:list[1]:kind" value="'mac'" /> <mvt:assign name="l.settings:list[1]:color" value="'a'" /> <mvt:assign name="l.settings:list[2]:name" value="'bananas'" /> <mvt:assign name="l.settings:list[2]:kind" value="'South American'" /> <mvt:assign name="l.settings:list[2]:color" value="'C'" /> <mvt:assign name="l.settings:list[3]:name" value="'orange'" /> <mvt:assign name="l.settings:list[3]:kind" value="'Florida'" /> <mvt:assign name="l.settings:list[3]:color" value="'b'" /> <mvt:assign name="l.settings:list[4]:name" value="'orange'" /> <mvt:assign name="l.settings:list[4]:kind" value="'Michigan'" /> <mvt:assign name="l.settings:list[4]:color" value="'d'" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> name: &mvt:item:name;<br> kind: &mvt:item:kind;<br> color: &mvt:item:color;<br> <hr/> </mvt:foreach> <mvt:comment> | | while loop to create new array and add colorsort field | </mvt:comment> <mvt:assign name="l.elements" value="miva_array_elements(l.settings:list)" /> <mvt:while expr="l.counter LT l.elements"> <mvt:assign name="l.counter" value="l.counter + 1" /> <mvt:assign name="l.struct" value="l.settings:list[l.counter]" /> <mvt:assign name="l.struct:colorsort" value="toupper(l.struct:color)" /> <mvt:assign name="l.success" value="miva_array_insert( l.settings:newlist, l.struct, -1 )" /> </mvt:while> <mvt:comment> | |copy new array to original, sort, and display new list | </mvt:comment> <mvt:assign name="l.settings:list" value="l.settings:newlist" /> <mvt:do file="g.module_library_utilities" name="l.success" value="QuickSortArray(l.settings:list,':colorsort', 1)" /> <h2>After Sort</h2> <mvt:foreach iterator="item" array="list"> name: &mvt:item:name;<br> kind: &mvt:item:kind;<br> color: &mvt:item:color;<br> colorSort: &mvt:item:colorSort; <hr/> </mvt:foreach>
 

Miva Template Language New Array and Sort Example

Use Miva Template language to sort an existing array by inserting sort keys into the array structure. This is done by creating a new temporary structure with the sort key (colorsort), and then add it to a new array using miva_array_insert(..). When the loop is done, the new temporary array is then copied back into the original array. In miva_array_insert(...) we use -1 for the array index to force it to add the structure to the next array element. Since we are creating a new array, it will be populated from index 1 to the end. We do it this way because there is no other way to add to array structures in the miva template language. Using brackets when trying to add to existing array structures does not work in the miva template language. http://www.scotsscripts.com
Created: 1496961839
View "Miva Template Language New Array and Sort Example"
<mvt:comment>Example by http://www.scotsscripts.com</mvt:comment> <mvt:assign name="l.settings:list[1]:name" value="'apples'" /> <mvt:assign name="l.settings:list[1]:kind" value="'mac'" /> <mvt:assign name="l.settings:list[1]:color" value="'a'" /> <mvt:assign name="l.settings:list[2]:name" value="'bananas'" /> <mvt:assign name="l.settings:list[2]:kind" value="'South American'" /> <mvt:assign name="l.settings:list[2]:color" value="'C'" /> <mvt:assign name="l.settings:list[3]:name" value="'orange'" /> <mvt:assign name="l.settings:list[3]:kind" value="'Florida'" /> <mvt:assign name="l.settings:list[3]:color" value="'b'" /> <mvt:assign name="l.settings:list[4]:name" value="'orange'" /> <mvt:assign name="l.settings:list[4]:kind" value="'Michigan'" /> <mvt:assign name="l.settings:list[4]:color" value="'d'" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> name: &mvt:item:name;<br> kind: &mvt:item:kind;<br> color: &mvt:item:color;<br> <hr/> </mvt:foreach> <mvt:comment>While loop To Create New Array</mvt:comment> <mvt:assign name="l.elements" value="miva_array_elements(l.settings:list)" /> <mvt:while expr="l.counter LT l.elements"> <mvt:assign name="l.counter" value="l.counter + 1" /> <mvt:assign name="l.struct" value="l.settings:list[l.counter]" /> <mvt:assign name="l.struct:colorsort" value="toupper(l.struct:color)" /> <mvt:assign name="l.success" value="miva_array_insert( l.settings:newlist, l.struct, -1 )" /> </mvt:while> <mvt:comment>copy new array to original array</mvt:comment> <mvt:assign name="l.settings:list" value="l.settings:newlist" /> <mvt:comment>sort original array</mvt:comment> <mvt:do file="g.module_library_utilities" name="l.success" value="QuickSortArray(l.settings:list,':colorsort', 1)" /> <h2>After Sort</h2> <mvt:foreach iterator="item" array="list"> name: &mvt:item:name;<br> kind: &mvt:item:kind;<br> color: &mvt:item:color;<br> colorSort: &mvt:item:colorSort; <hr/> </mvt:foreach>
 

Miva Template Language New Array and Sort Example

Use Miva Template language to sort an existing array by inserting sort keys into the array structure. This is done by creating a new temporary structure with the sort key (colorsort), and then add it to a new array using miva_array_insert(..). When the loop is done, the new temporary array is then copied back into the original array. In miva_array_insert(...) we use -1 for the array index to force it to add the structure to the next array element. Since we are creating a new array, it will be populated from index 1 to the end. We do it this way because there is no other way to add to array structures in the miva template language. Using brackets when trying to add to existing array structures does not work in the miva template language. http://www.scotsscripts.com
Created: 1496961811
View "Miva Template Language New Array and Sort Example"
TEST<br><br> <mvt:assign name="l.settings:list[1]:name" value="'apples'" /> <mvt:assign name="l.settings:list[1]:kind" value="'mac'" /> <mvt:assign name="l.settings:list[1]:color" value="'a'" /> <mvt:assign name="l.settings:list[2]:name" value="'bananas'" /> <mvt:assign name="l.settings:list[2]:kind" value="'South American'" /> <mvt:assign name="l.settings:list[2]:color" value="'C'" /> <mvt:assign name="l.settings:list[3]:name" value="'orange'" /> <mvt:assign name="l.settings:list[3]:kind" value="'Florida'" /> <mvt:assign name="l.settings:list[3]:color" value="'b'" /> <mvt:assign name="l.settings:list[4]:name" value="'orange'" /> <mvt:assign name="l.settings:list[4]:kind" value="'Michigan'" /> <mvt:assign name="l.settings:list[4]:color" value="'d'" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> name: &mvt:item:name;<br> kind: &mvt:item:kind;<br> color: &mvt:item:color;<br> <hr/> </mvt:foreach> <mvt:comment>While loop To Create New Array</mvt:comment> <mvt:assign name="l.elements" value="miva_array_elements(l.settings:list)" /> <mvt:while expr="l.counter LT l.elements"> <mvt:assign name="l.counter" value="l.counter + 1" /> <mvt:assign name="l.struct" value="l.settings:list[l.counter]" /> <mvt:assign name="l.struct:colorsort" value="toupper(l.struct:color)" /> <mvt:assign name="l.success" value="miva_array_insert( l.settings:newlist, l.struct, -1 )" /> </mvt:while> <mvt:comment>copy new array to original array</mvt:comment> <mvt:assign name="l.settings:list" value="l.settings:newlist" /> <mvt:comment>sort original array</mvt:comment> <mvt:do file="g.module_library_utilities" name="l.success" value="QuickSortArray(l.settings:list,':colorsort', 1)" /> <h2>After Sort</h2> <mvt:foreach iterator="item" array="list"> name: &mvt:item:name;<br> kind: &mvt:item:kind;<br> color: &mvt:item:color;<br> colorSort: &mvt:item:colorSort; <hr/> </mvt:foreach>
 

Miva Template Language New Array and Sort Example

Use Miva Template language to sort an existing array by inserting sort keys into the array structure. This is done by creating a new temporary structure with the sort key (colorsort), and then add it to a new array using miva_array_insert(..). When the loop is done, the new temporary array is then copied back into the original array. In miva_array_insert(...) we use -1 for the array index to force it to add the structure to the next array element. Since we are creating a new array, it will be populated from index 1 to the end. We do it this way because there is no other way to add to array structures in the miva template language. Using brackets when trying to add to existing array structures does not work in the miva template language. http://www.scotsscripts.com
Created: 1496961745
View "Miva Template Language New Array and Sort Example"
TEST<br><br> <mvt:assign name="l.settings:list[1]:name" value="'apples'" /> <mvt:assign name="l.settings:list[1]:kind" value="'mac'" /> <mvt:assign name="l.settings:list[1]:color" value="'a'" /> <mvt:assign name="l.settings:list[2]:name" value="'bananas'" /> <mvt:assign name="l.settings:list[2]:kind" value="'South American'" /> <mvt:assign name="l.settings:list[2]:color" value="'C'" /> <mvt:assign name="l.settings:list[3]:name" value="'orange'" /> <mvt:assign name="l.settings:list[3]:kind" value="'Florida'" /> <mvt:assign name="l.settings:list[3]:color" value="'b'" /> <mvt:assign name="l.settings:list[4]:name" value="'orange'" /> <mvt:assign name="l.settings:list[4]:kind" value="'Michigan'" /> <mvt:assign name="l.settings:list[4]:color" value="'d'" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> name: &mvt:item:name;<br> kind: &mvt:item:kind;<br> color: &mvt:item:color;<br> <hr/> </mvt:foreach> <h3>While loop To Create New Array</h3> <mvt:assign name="l.elements" value="miva_array_elements(l.settings:list)" /> <mvt:while expr="l.counter LT l.elements"> <mvt:assign name="l.counter" value="l.counter + 1" /> <mvt:assign name="l.struct" value="l.settings:list[l.counter]" /> <mvt:assign name="l.struct:colorsort" value="toupper(l.struct:color)" /> <mvt:assign name="l.success" value="miva_array_insert( l.settings:newlist, l.struct, -1 )" /> </mvt:while> <mvt:assign name="l.settings:list" value="l.settings:newlist" /> <mvt:do file="g.module_library_utilities" name="l.success" value="QuickSortArray(l.settings:list,':colorsort', 1)" /> <h2>After Sort</h2> <mvt:foreach iterator="item" array="list"> name: &mvt:item:name;<br> kind: &mvt:item:kind;<br> color: &mvt:item:color;<br> colorSort: &mvt:item:colorSort; <hr/> </mvt:foreach>
 
View "Miva Template Language New Array and Sort Example"
TEST<br><br> <mvt:assign name="l.settings:list[1]:name" value="'apples'" /> <mvt:assign name="l.settings:list[1]:kind" value="'mac'" /> <mvt:assign name="l.settings:list[1]:color" value="'a'" /> <mvt:assign name="l.settings:list[2]:name" value="'bananas'" /> <mvt:assign name="l.settings:list[2]:kind" value="'South American'" /> <mvt:assign name="l.settings:list[2]:color" value="'C'" /> <mvt:assign name="l.settings:list[3]:name" value="'orange'" /> <mvt:assign name="l.settings:list[3]:kind" value="'Florida'" /> <mvt:assign name="l.settings:list[3]:color" value="'b'" /> <mvt:assign name="l.settings:list[4]:name" value="'orange'" /> <mvt:assign name="l.settings:list[4]:kind" value="'Michigan'" /> <mvt:assign name="l.settings:list[4]:color" value="'d'" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> name: &mvt:item:name;<br> kind: &mvt:item:kind;<br> color: &mvt:item:color;<br> <hr/> </mvt:foreach> <h3>While loop To Create New Array</h3> <mvt:assign name="l.elements" value="miva_array_elements(l.settings:list)" /> <mvt:while expr="l.counter LT l.elements"> <mvt:assign name="l.counter" value="l.counter + 1" /> <mvt:assign name="l.struct" value="l.settings:list[l.counter]" /> <mvt:assign name="l.struct:colorsort" value="toupper(l.struct:color)" /> <mvt:assign name="l.success" value="miva_array_insert( l.settings:newlist, l.struct, -1 )" /> </mvt:while> <mvt:assign name="l.settings:list" value="l.settings:newlist" /> <mvt:do file="g.module_library_utilities" name="l.success" value="QuickSortArray(l.settings:list,':colorsort', 1)" /> <h2>After Sort</h2> <mvt:foreach iterator="item" array="list"> name: &mvt:item:name;<br> kind: &mvt:item:kind;<br> color: &mvt:item:color;<br> colorSort: &mvt:item:colorSort; <hr/> </mvt:foreach>
 

Basket #46929

Usage of QuickSortArray
Created: 1496956311
View "Basket #46929"
<mvt:comment> | | By http://www.scotsscripts.com | </mvt:comment> <mvt:assign name="l.settings:order[1]:id" value="'1'" /> <mvt:assign name="l.settings:order[1]:order_status" value="'In Progress'" /> <mvt:assign name="l.settings:order[2]:id" value="'2'" /> <mvt:assign name="l.settings:order[2]:order_status" value="'In Progress'" /> <mvt:assign name="l.settings:order[3]:id" value="'3'" /> <mvt:assign name="l.settings:order[3]:order_status" value="'Pending'" /> <mvt:assign name="l.settings:order[4]:id" value="'4'" /> <mvt:assign name="l.settings:order[4]:order_status" value="'In Progress'" /> <p><b>Original:</b></p> <mvt:foreach iterator="item" array="order"> id: &mvt:item:id; status: &mvt:item:order_status;<br> </mvt:foreach> <mvt:assign name="l.elements" value="miva_array_elements(l.settings:order)" /> <mvt:while expr="l.counter LT l.elements"> <mvt:assign name="l.counter" value="l.counter + 1" /> <mvt:assign name="l.struct" value="l.settings:order[l.counter]" /> <mvt:if expr="tolower(l.struct:order_status) EQ 'pending'"> <mvt:assign name="l.struct:order_status" value="'In Progress'" /> </mvt:if> <mvt:assign name="l.success" value="miva_array_insert( l.settings:temp_array, l.struct, -1 )" /> </mvt:while> <mvt:assign name="l.settings:order" value="l.settings:temp_array" /> <p><b>Updated:</b></p> <mvt:foreach iterator="item" array="order"> id: &mvt:item:id; status: &mvt:item:order_status;<br> </mvt:foreach>
 

Basket #46923

Usage of QuickSortArray
Created: 1496950718
View "Basket #46923"
<mvt:comment> | | By http://www.scotsscripts.com | </mvt:comment> <mvt:assign name="l.settings:list[1]:name" value="'apples'" /> <mvt:assign name="l.settings:list[1]:kind" value="'mac'" /> <mvt:assign name="l.settings:list[1]:color" value="'a'" /> <mvt:assign name="l.settings:list[2]:name" value="'bananas'" /> <mvt:assign name="l.settings:list[2]:kind" value="'South American'" /> <mvt:assign name="l.settings:list[2]:color" value="'C'" /> <mvt:assign name="l.settings:list[3]:name" value="'orange'" /> <mvt:assign name="l.settings:list[3]:kind" value="'Florida'" /> <mvt:assign name="l.settings:list[3]:color" value="'b'" /> <mvt:assign name="l.settings:list[4]:name" value="'orange'" /> <mvt:assign name="l.settings:list[4]:kind" value="'Michigan'" /> <mvt:assign name="l.settings:list[4]:color" value="'d'" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> name: &mvt:item:name;<br> kind: &mvt:item:kind;<br> color: &mvt:item:color;<br> <hr/> </mvt:foreach> <mvt:comment> | | while loop to create new array and add colorsort field | </mvt:comment> <mvt:assign name="l.elements" value="miva_array_elements(l.settings:list)" /> <mvt:while expr="l.counter LT l.elements"> <mvt:assign name="l.counter" value="l.counter + 1" /> <mvt:assign name="l.struct" value="l.settings:list[l.counter]" /> <mvt:assign name="l.struct:colorsort" value="toupper(l.struct:color)" /> <mvt:assign name="l.success" value="miva_array_insert( l.settings:newlist, l.struct, -1 )" /> </mvt:while> <mvt:comment> | |copy new array to original, sort, and display new list | </mvt:comment> <mvt:assign name="l.settings:list" value="l.settings:newlist" /> <mvt:do file="g.module_library_utilities" name="l.success" value="QuickSortArray(l.settings:list,':colorsort', -1)" /> <h2>After Sort</h2> <mvt:foreach iterator="item" array="list"> name: &mvt:item:name;<br> kind: &mvt:item:kind;<br> color: &mvt:item:color;<br> colorSort: &mvt:item:colorSort; <hr/> </mvt:foreach>
 
View "Basket #46802"
<mvt:assign name="l.settings:basket:items[1]:code" value="'doe'" /> <mvt:assign name="l.settings:basket:items[2]:code" value="'ray'" /> <mvt:assign name="l.settings:basket:items[3]:code" value="'mee'" /> <mvt:assign name="l.settings:basket:items[4]:code" value="'fah'" /> <mvt:assign name="l.settings:basket:items[5]:code" value="'soh'" /> <mvt:assign name="l.settings:basket:items[6]:code" value="'lah'" /> <mvt:assign name="l.settings:basket:items[7]:code" value="'tee'" /> <h2>Always at End</h2> <mvt:foreach iterator="item" array="basket:items"> "&mvt:item:code;", </mvt:foreach> <h2>Using POS1</h2> <mvt:foreach iterator="item" array="basket:items"> <mvt:if expr="POS1 EQ 2">,</mvt:if> "&mvt:item:code;" </mvt:foreach> <hr> &mvt:basket:items[4]:code;
 

Basket #46697

[Video Tutorial](http://www.miva.com/videos/web_developers/structures) Structures are a lot like arrays.
Created: 1496853449
View "Basket #46697"
<mvt:assign name="g.foo" value="'bar'" /> &mvte:global:foo;<mvt:assign name="g.foo" value="'bar'" /> &mvte:global:foo;<mvt:assign name="g.foo" value="'bar'" /> &mvte:global:foo;<mvt:assign name="g.foo" value="'bar'" /> &mvte:global:foo;<mvt:assign name="g.foo" value="'bar'" /> &mvte:global:foo;<mvt:assign name="l.settings:example:foo" value="'bar'" /> <mvt:assign name="l.settings:example:bar" value="'baz'" /> &mvt:example:foo;<br> &mvt:example:bar;<br> <hr> <mvt:assign name="l.settings:example:list[0]" value="'Bananas'" /> <mvt:assign name="l.settings:example:list[1]" value="'Milk'" /> <mvt:assign name="l.settings:example:list[2]" value="'Bread'" /> <mvt:assign name="l.settings:example:list[3]" value="'Cereal'" /> &mvt:example:list[0];<br> &mvt:example:list[1];<br> &mvt:example:list[2];<br> &mvt:example:list[3];<br> <br> <mvt:foreach iterator="item" array="example:list"> &mvt:item;<br> </mvt:foreach> <hr> <mvt:assign name="l.settings:example:states[0]:abbr" value="'CA'" /> <mvt:assign name="l.settings:example:states[0]:name" value="'California'" /> <mvt:assign name="l.settings:example:states[1]:abbr" value="'FL'" /> <mvt:assign name="l.settings:example:states[1]:name" value="'Florida'" /> &mvt:example:states[0]:abbr; - &mvt:example:states[0]:name;<br> &mvt:example:states[1]:abbr; - &mvt:example:states[1]:name;<br> <br> <mvt:foreach iterator="state" array="example:states"> &mvt:state:abbr; - &mvt:state:name;<br> </mvt:foreach> <hr> <h4>Print Example Structure:</h4> <mvt:eval expr="decodeattribute(glosub(miva_array_serialize(l.settings:example), ',', '<br>'))" />
 
View "Basket #40303"
<mvt:assign name="l.settings:attributes[1]:template_code" value="'size'" /> <mvt:assign name="l.settings:attributes[1]:prompt" value="'Select a Size:'" /> <mvt:assign name="l.settings:attributes[2]:template_code" value="'color'" /> <mvt:assign name="l.settings:attributes[2]:prompt" value="'Select a Color:'" /> <mvt:assign name="l.settings:attributes[3]:template_code" value="'foo'" /> <mvt:assign name="l.settings:attributes[3]:prompt" value="'Foo Bar:'" /> <mvt:assign name="l.settings:attributes[4]:template_code" value="'baz'" /> <mvt:assign name="l.settings:attributes[4]:prompt" value="'Baz!:'" /> <mvt:assign name="g.var" value="'foo'" /> POS: <mvt:eval expr="miva_array_search( l.settings:attributes, 1, l.attribute, 'l.attribute:template_code EQ \'' $ g.var $ '\'' )" /> <mvt:eval expr="l.attribute"/>
 
View "Basket #40204"
<mvt:assign name="l.settings:attributes[1]:template_code" value="'size'" /> <mvt:assign name="l.settings:attributes[1]:prompt" value="'Select a Size:'" /> <mvt:assign name="l.settings:attributes[2]:template_code" value="'color'" /> <mvt:assign name="l.settings:attributes[2]:prompt" value="'Select a Color:'" /> <mvt:assign name="l.settings:attributes[3]:template_code" value="'foo'" /> <mvt:assign name="l.settings:attributes[3]:prompt" value="'Foo Bar:'" /> <mvt:assign name="l.settings:attributes[4]:template_code" value="'baz'" /> <mvt:assign name="l.settings:attributes[4]:prompt" value="'Baz!:'" /> <mvt:assign name="g.var" value="'foo'" /> POS: <mvt:eval expr="miva_array_search( l.settings:attributes, 1, l.attribute, 'l.attribute:template_code EQ \'' $ g.var $ '\'' )" /> <mvt:eval expr="l.attribute"/>
 

Snippet: 1490660523 - v2

[Video Tutorial](http://www.miva.com/videos/web_developers/structures) Structures are a lot like arrays.
Created: 1490660534
View "Snippet: 1490660523 - v2"
<mvt:assign name="l.settings:example:foo" value="'bar'" /> <mvt:assign name="l.settings:example:bar" value="'baz'" /> &mvt:example:foo;<br> &mvt:example:bar;<br> <hr> <mvt:assign name="l.settings:example:list[1]" value="'Bananas'" /> <mvt:assign name="l.settings:example:list[2]" value="'Milk'" /> <mvt:assign name="l.settings:example:list[3]" value="'Bread'" /> <mvt:assign name="l.settings:example:list[4]" value="'Cereal'" /> &mvt:example:list[0];<br> &mvt:example:list[1];<br> &mvt:example:list[2];<br> &mvt:example:list[3];<br> <br> <mvt:foreach iterator="item" array="example:list"> &mvt:item;<br> </mvt:foreach> <hr> <mvt:assign name="l.settings:example:states[1]:abbr" value="'CA'" /> <mvt:assign name="l.settings:example:states[1]:name" value="'California'" /> <mvt:assign name="l.settings:example:states[2]:abbr" value="'FL'" /> <mvt:assign name="l.settings:example:states[2]:name" value="'Florida'" /> &mvt:example:states[1]:abbr; - &mvt:example:states[1]:name;<br> &mvt:example:states[2]:abbr; - &mvt:example:states[2]:name;<br> <br> <mvt:foreach iterator="state" array="example:states"> &mvt:state:abbr; - &mvt:state:name;<br> </mvt:foreach> <hr> <h4>Print Example Structure:</h4> <mvt:eval expr="decodeattribute(glosub(miva_array_serialize(l.settings:example), ',', '<br>'))" />
 

Snippet: 1490660523 - v1

[Video Tutorial](http://www.miva.com/videos/web_developers/structures) Structures are a lot like arrays.
Created: 1490660523
View "Snippet: 1490660523 - v1"
<mvt:assign name="l.settings:example:foo" value="'bar'" /> <mvt:assign name="l.settings:example:bar" value="'baz'" /> &mvt:example:foo;<br> &mvt:example:bar;<br> <hr> <mvt:assign name="l.settings:example:list[1]" value="'Bananas'" /> <mvt:assign name="l.settings:example:list[2]" value="'Milk'" /> <mvt:assign name="l.settings:example:list[3]" value="'Bread'" /> <mvt:assign name="l.settings:example:list[4]" value="'Cereal'" /> &mvt:example:list[0];<br> &mvt:example:list[1];<br> &mvt:example:list[2];<br> &mvt:example:list[3];<br> <br> <mvt:foreach iterator="item" array="example:list"> &mvt:item;<br> </mvt:foreach> <hr> <mvt:assign name="l.settings:example:states[1]:abbr" value="'CA'" /> <mvt:assign name="l.settings:example:states[1]:name" value="'California'" /> <mvt:assign name="l.settings:example:states[2]:abbr" value="'FL'" /> <mvt:assign name="l.settings:example:states[2]:name" value="'Florida'" /> &mvt:example:states[1]:abbr; - &mvt:example:states[1]:name;<br> &mvt:example:states[2]:abbr; - &mvt:example:states[2]:name;<br> <br> <mvt:foreach iterator="state" array="example:states"> &mvt:state:abbr; - &mvt:state:name;<br> </mvt:foreach> <hr> <h4>Print Example Structure:</h4> <mvt:eval expr="decodeattribute(glosub(miva_array_serialize(l.settings:example), ',', '<br>'))" />
 

Basket #36203

[Video Tutorial](http://www.miva.com/videos/web_developers/structures) Structures are a lot like arrays.
Created: 1489530230
View "Basket #36203"
<mvt:assign name="l.settings:example:foo" value="'bar'" /> <mvt:assign name="l.settings:example:bar" value="'baz'" /> &mvt:example:foo;<br> &mvt:example:bar;<br> <hr> <mvt:assign name="l.settings:example:list[0]" value="'Bananas'" /> <mvt:assign name="l.settings:example:list[1]" value="'Milk'" /> <mvt:assign name="l.settings:example:list[2]" value="'Bread'" /> <mvt:assign name="l.settings:example:list[3]" value="'Cereal'" /> &mvt:example:list[0];<br> &mvt:example:list[1];<br> &mvt:example:list[2];<br> &mvt:example:list[3];<br> <br> <mvt:foreach iterator="item" array="example:list"> &mvt:item;<br> </mvt:foreach> <hr> <mvt:assign name="l.settings:example:states[0]:abbr" value="'CA'" /> <mvt:assign name="l.settings:example:states[0]:name" value="'California'" /> <mvt:assign name="l.settings:example:states[1]:abbr" value="'FL'" /> <mvt:assign name="l.settings:example:states[1]:name" value="'Florida'" /> &mvt:example:states[0]:abbr; - &mvt:example:states[0]:name;<br> &mvt:example:states[1]:abbr; - &mvt:example:states[1]:name;<br> <br> <mvt:foreach iterator="state" array="example:states"> &mvt:state:abbr; - &mvt:state:name;<br> </mvt:foreach> <hr> <h4>Print Example Structure:</h4> <mvt:eval expr="decodeattribute(glosub(miva_array_serialize(l.settings:example), ',', '<br>'))" /> <hr> <mvt:assign name="l.settings:testArray:color[1]" value="'red'" /> <mvt:assign name="l.settings:testArray:color[2]" value="'blue'" /> <mvt:assign name="l.settings:testArray:color[3]" value="'green'" /> <mvt:assign name="l.settings:testArray:color[4]" value="'orange'" /> <mvt:assign name="l.settings:testArray:color[5]" value="'yellow'" /> <mvt:foreach iterator="color" array="testArray:color"> <mvt:if expr="pos1 MOD 4 EQ 0"> &mvte:color; </mvt:if> </mvt:foreach> <hr> <mvt:assign name="l.settings:some_string" value="'My name is Juan.'" /> <mvt:assign name="l.settings:replace_string" value="glosub(l.settings:some_string, 'My name is', 'Me llamo')" /> &mvte:some_string;<br /> &mvte:replace_string; <hr> <mvt:assign name="l.settings:one" value="'Hello my name is '" /> <mvt:assign name="l.settings:two" value="'James'" /> <mvt:eval expr="l.settings:one $ l.settings:two" /> <hr> <mvt:assign name="l.settings:three" value="'Hello my name is James.'" /> <mvt:assign name="four" value="substring(l.settings:three, 6, len(l.settings:three))" /> &mvte:global:four; <hr> <mvt:assign name="l.name" value="'James'" /> &mvte:name; <!-- nope --> <mvt:eval expr="name" /> <!-- yep -->
 
View "Basket #32640"
<style> #email-popup{ max-width: 449px; min-height: 250px; text-align: center; background: green; padding: 1.5rem; } .popup-line-one{ font-size: 2rem; } .popup-line-two{ font-size: 1.2rem; text-transform: uppercase; } .popup-hr{ height: 1px; background: #000; max-width: 50px; margin: .5rem auto; } .popup-text{ font-size: 1rem; } #popup-form{ width: 100%; } #email-popup input{ border: 1px solid #DEDEDE; width: 100%; height: 42px; } </style> <div id="email-popup"> <div class="popup-line-one">15% Off</div> <div class="popup-line-two">Your first order</div> <div class="popup-hr"></div> <div class="popup-text">Be the first to know about our promotions, limited edition products and other rad stuff!</div> <br /> <form id="popup-form"> <input type="email" placeholder="Enter your email here" /> </form> </div>
 

Basket #32556

Created: 1486502850
View "Basket #32556"
<mvt:assign name="l.settings:shippingmethods[1]:price" value="71.38"/> <mvt:assign name="l.settings:shippingmethods[2]:price" value="17.37"/> <mvt:assign name="l.settings:shippingmethods[3]:price" value="18.42"/> <mvt:assign name="l.settings:shippingmethods[4]:price" value="71.39"/> <mvt:assign name="l.settings:shippingmethods[1]:cost" value="1"/> <mvt:assign name="l.settings:shippingmethods[3]:cost" value="2"/> <mvt:assign name="l.settings:shippingmethods[4]:cost" value="3"/> <mvt:assign name="l.settings:shippingmethods[2]:cost" value="4"/> <h2>Before</h2> <mvt:foreach iterator="item" array="shippingmethods"> &mvt:item;<br> </mvt:foreach> <mvt:do file="g.module_library_utilities" name="l.null" value="QuickSortArray(l.settings:shippingmethods, ':cost', 1)" /> <h2>After</h2> <mvt:foreach iterator="item" array="shippingmethods"> &mvt:item;<br> </mvt:foreach> <mvt:assign name="l.settings:test1" value="':price'"/> <mvt:assign name="g.return_value" value="miva_array_sort( l.settings:shippingmethods,'',l.settings:test1)" /> <Br /> <Br /> <Br /> <mvt:foreach iterator="item" array="shippingmethods"> &mvt:item;<br> </mvt:foreach>
 

Basket #32004

[Video Tutorial](http://www.miva.com/videos/web_developers/structures) Structures are a lot like arrays.
Created: 1485540531
View "Basket #32004"
<mvt:assign name="g.basketTotalWeight" value="0.02 * power(10,2)" /> &mvt:global:basketTotalWeight;
 

Basket #31523

 arrays
Created: 1484586117
View "Basket #31523"
<must be l.settings> <mvt:assign name="l.settings:sliderProds[1]:name" value="'1965-67'" /> <mvt:assign name="l.settings:sliderProds[1]:desc" value="'1965-67 VW Beetle Stock Style Seat Upholstery'" /> <mvt:assign name="l.settings:sliderProds[1]:link" value="''" /> <mvt:assign name="l.settings:sliderProds[1]:src" value="'http://mivadev.jbugs.com/store/graphics/00000001/1965-1967%20VW%20Beetle%20Stock%20Seat%20Style.jpg'" /> <mvt:assign name="l.settings:sliderProds[1]:expand" value="'Florida'" /> <mvt:assign name="l.settings:sliderProds[2]:name" value="'1965-67'" /> <mvt:assign name="l.settings:sliderProds[2]:desc" value="'1965-67 VW Beetle Stock Style Seat Upholstery'" /> <mvt:assign name="l.settings:sliderProds[2]:link" value="''" /> <mvt:assign name="l.settings:sliderProds[2]:src" value="'http://mivadev.jbugs.com/store/graphics/00000001/1965-1967%20VW%20Beetle%20Stock%20Seat%20Style.jpg'" /> <mvt:assign name="l.settings:sliderProds[2]:expand" value="'Florida'" /> <mvt:assign name="l.settings:sliderProds[3]:name" value="'1968-69'" /> <mvt:assign name="l.settings:sliderProds[3]:desc" value="'1968-69 VW Beetle Stock Style Seat Upholstery'" /> <mvt:assign name="l.settings:sliderProds[3]:link" value="''" /> <mvt:assign name="l.settings:sliderProds[3]:src" value="'http://mivadev.jbugs.com/store/graphics/00000001/1965-1967%20VW%20Beetle%20Stock%20Seat%20Style.jpg'" /> <mvt:assign name="l.settings:sliderProds[3]:expand" value="'Florida'" /> <mvt:if expr="NOT ISNULL l.settings:sliderProds"> !!!!!! I AM HERE !!!!!! </mvt:if> <mvt:assign name="g.sliderProds" value="l.settings:sliderProds" /> <b>SHOW ME: </b> &mvt:global:sliderProds; <hr></hr> <mvt:foreach iterator="item" array="sliderProds"> &mvt:item:name; - &mvt:item:desc;<br> </mvt:foreach> <hr></hr> <mvt:assign name="g.new" value="l.settings:sliderProds" /> ##&mvt:global:new;## <!-- <hr></hr> <mvt:eval expr="decodeattribute(glosub(miva_array_serialize(l.settings:sliderProds), ',', '<br>'))" /> -->
 
View "Basket #31387"
<mvt:comment>JSON Data</mvt:comment> <mvt:assign name="l.settings:rotating_img_data" value="'[ { \"name\": \"Product1\", \"number\": \"5003", \"src\": \"http://www.clivecoffee.com/img/bio/ben.png\" }, { \"name\": \"Product1\", \"number\": \"5002", \"src\": \"http://www.clivecoffee.com/images/products/affirm-icon-product-page_2x.png\" }, { \"name\": \"Product1\", \"number\": \"5302", \"src\": \"http://www.clivecoffee.com/images/products/affirm-icon-product-page_2x.png\" }, ]'" /> <mvt:assign name="l.success" value="miva_json_decode(l.settings:rotating_img_data, l.settings:salespersons)" /> <mvt:comment>Assign array length</mvt:comment> <mvt:assign name="l.salespersons_count" value="miva_array_elements( l.settings:salespersons )" /> <mvt:comment>Shuffle array attempt</mvt:comment> Before:<br><mvt:eval expr="decodeattribute(glosub(miva_array_serialize(l.settings:salespersons), ',', '<br>'))" /><br> <mvt:foreach iterator="salesperson" array="salespersons"> <mvt:assign name="g.tempRand" value="random(l.salespersons_count - 1)" /> <mvt:assign name="g.tempVal" value="l.settings:salesperson" /> <mvt:assign name="l.settings:salesperson" value="l.settings:salespersons[g.tempRand]" /> <mvt:assign name="l.settings:salespersons[g.tempRand + 1]" value="g.tempVal" /> </mvt:foreach> After:<br><mvt:eval expr="decodeattribute(glosub(miva_array_serialize(l.settings:salespersons), ',', '<br>'))" /><br>
 

Basket #28881

[Video Tutorial](http://www.miva.com/videos/web_developers/structures) Structures are a lot like arrays.
Created: 1481045647
View "Basket #28881"
<mvt:assign name="l.settings:example:foo" value="'bar'" /> <mvt:assign name="l.settings:example:bar" value="'baz'" /> &mvt:example:foo;<br> &mvt:example:bar;<br> <hr> <mvt:assign name="l.settings:example:list[0]" value="'Bananas'" /> <mvt:assign name="l.settings:example:list[1]" value="'Milk'" /> <mvt:assign name="l.settings:example:list[2]" value="'Bread'" /> <mvt:assign name="l.settings:example:list[3]" value="'Cereal'" /> &mvt:example:list[0];<br> &mvt:example:list[1];<br> &mvt:example:list[2];<br> &mvt:example:list[3];<br> <br> <mvt:foreach iterator="item" array="example:list"> &mvt:item;<br> </mvt:foreach> <hr> <mvt:assign name="l.settings:example:states[0]:abbr" value="'CA'" /> <mvt:assign name="l.settings:example:states[0]:name" value="'California'" /> <mvt:assign name="l.settings:example:states[1]:abbr" value="'FL'" /> <mvt:assign name="l.settings:example:states[1]:name" value="'Florida'" /> &mvt:example:states[0]:abbr; - &mvt:example:states[0]:name;<br> &mvt:example:states[1]:abbr; - &mvt:example:states[1]:name;<br> <br> <mvt:foreach iterator="state" array="example:states"> &mvt:state:abbr; - &mvt:state:name;<br> </mvt:foreach> <hr> <h4>Print Example Structure:</h4> <mvt:eval expr="decodeattribute(glosub(miva_array_serialize(l.settings:example), ',', '<br>'))" />
 

Basket #28862

Created: 1480959480
View "Basket #28862"
<mvt:assign name="l.settings:list[3]" value="'apples'" /> <mvt:assign name="l.settings:list[1]" value="'bananas'" /> <mvt:assign name="l.settings:list[2]" value="'carrots'" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach> <mvt:do file="g.module_library_utilities" name="l.null" value="QuickSortArray(l.settings:list, '', 1)" /> <h2>After</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach>
 

Basket #27719

Created: 1478806093
View "Basket #27719"
<mvt:assign name="g.foo" value="'bar'" /> &mvte:global:foo;<mvt:eval expr="2 + 2" /><mvt:while expr="g.counter LT 10"> <mvt:assign name="g.counter" value="g.counter + 1" /> &mvte:global:counter;<br> </mvt:while>
 

Basket #27695

Created: 1478733584
View "Basket #27695"
<mvt:assign name="l.settings:list[1]" value="'apples'" /> <mvt:assign name="l.settings:list[2]" value="'bananas'" /> <mvt:assign name="l.settings:list[3]" value="'carrots'" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach> <mvt:do file="g.module_library_utilities" name="l.null" value="QuickSortArray(l.settings:list, '', 1)" /> <h2>After</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach>
 

Basket #27067

 arrays
Delete all characters from string except characters that you define.
Created: 1477411980
View "Basket #27067"
<mvt:assign name="l.settings:yearsfits[1]" value="'1954'" /> <mvt:assign name="l.settings:yearsfits[2]" value="'1955'" /> <mvt:assign name="l.settings:yearsfits[3]" value="'1956'" /> <mvt:assign name="l.settings:yearsfits[4]" value="'1957'" /> <mvt:assign name="l.settings:yearsfits[5]" value="'1958'" /> <mvt:assign name="l.settings:yearsfits[6]" value="'1959'" /> <mvt:assign name="l.settings:yearsfits[7]" value="'1960'" /> <mvt:assign name="l.settings:yearsfits[8]" value="'1961'" /> <mvt:assign name="l.settings:yearsfits[9]" value="'1962'" /> <mvt:assign name="l.settings:yearsfits[10]" value="'1963'" /> <mvt:assign name="l.settings:yearsfits[11]" value="'1964'" /> <mvt:assign name="l.settings:yearsfits[12]" value="'1965'" /> <mvt:assign name="l.settings:yearsfits[13]" value="'1966'" /> <mvt:assign name="l.settings:yearsfits[14]" value="'1967'" /> <mvt:assign name="l.settings:yearsfits[15]" value="'1968'" /> <mvt:assign name="l.settings:yearsfits[16]" value="'1969'" /> <mvt:assign name="l.settings:yearsfits[17]" value="'1970'" /> <mvt:assign name="l.settings:yearsfits[18]" value="'1971'" /> <mvt:assign name="l.settings:yearsfits[19]" value="'1972'" /> <mvt:assign name="l.settings:yearsfits[20]" value="'1973'" /> <mvt:assign name="l.settings:yearsfits[21]" value="'1974'" /> <mvt:assign name="l.settings:yearsfits[22]" value="'1975'" /> <mvt:assign name="l.settings:yearsfits[23]" value="'1976'" /> <mvt:assign name="l.settings:yearsfits[24]" value="'1977'" /> <mvt:assign name="l.settings:yearsfits[25]" value="'1954'" /> <mvt:assign name="l.settings:yearsfits[26]" value="'1955'" /> <mvt:assign name="l.settings:yearsfits[27]" value="'1956'" /> <mvt:assign name="l.settings:yearsfits[28]" value="'1957'" /> <mvt:assign name="l.settings:yearsfits[29]" value="'1958'" /> <mvt:assign name="l.settings:yearsfits[33]" value="'1962'" /> <mvt:assign name="l.settings:yearsfits[34]" value="'1963'" /> <mvt:assign name="l.settings:yearsfits[35]" value="'1964'" /> <mvt:assign name="l.settings:yearsfits[36]" value="'1965'" /> <mvt:assign name="l.settings:yearsfits[37]" value="'1966'" /> <mvt:assign name="l.settings:yearsfits[38]" value="'1967'" /> <mvt:assign name="l.settings:yearsfits[39]" value="'1968'" /> <mvt:assign name="l.settings:yearsfits[40]" value="'1969'" /> <mvt:assign name="l.settings:yearsfits[41]" value="'1970'" /> <mvt:assign name="l.settings:yearsfits[42]" value="'1971'" /> <mvt:assign name="l.settings:yearsfits[43]" value="'1972'" /> <mvt:assign name="l.settings:yearsfits[44]" value="'1973'" /> <mvt:assign name="l.settings:yearsfits[45]" value="'1974'" /> <mvt:assign name="l.settings:yearsfits[46]" value="'1975'" /> <mvt:assign name="l.settings:yearsfits[47]" value="'1976'" /> <mvt:assign name="l.settings:yearsfits[48]" value="'1977'" /> <mvt:foreach iterator="item" array="yearsfits"> &mvt:item;<br> </mvt:foreach>
 
View "Basket #26152"
<mvt:assign name="l.settings:attributes[1]:template_code" value="'size'" /> <mvt:assign name="l.settings:attributes[1]:prompt" value="'Select a Size:'" /> <mvt:assign name="l.settings:attributes[2]:template_code" value="'color'" /> <mvt:assign name="l.settings:attributes[2]:prompt" value="'Select a Color:'" /> <mvt:assign name="l.settings:attributes[3]:template_code" value="'foo'" /> <mvt:assign name="l.settings:attributes[3]:prompt" value="'Foo Bar:'" /> <mvt:assign name="l.settings:attributes[4]:template_code" value="'baz'" /> <mvt:assign name="l.settings:attributes[4]:prompt" value="'Baz!:'" /> <mvt:foreach iterator="attribute" array="attributes"> &mvt:attribute:prompt; &amp; &mvt:attribute:template_code;<br /> </mvt:foreach> <mvt:assign name="g.var" value="'foo'" /> POS: <mvt:eval expr="miva_array_search( l.settings:attributes, 1, l.attribute, 'l.attribute:template_code EQ \'' $ g.var $ '\'' )" /> <br /> <mvt:eval expr="l.attribute"/> <br /> No escape: <mvt:eval expr="miva_array_search( l.settings:attributes, 1, l.attribute, l.attribute:template_code EQ g.var)" /> <br /> Quotes: <mvt:eval expr="miva_array_search( l.settings:attributes, 1, l.attribute, l.attribute:template_code EQ 'g.var')" /> <br /> POS: <mvt:assign name="g.newvar" value="miva_array_search( l.settings:attributes, 1, l.attribute, 'l.attribute:template_code EQ \'' $ g.var $ '\'' )" /> &mvt:global:newvar; <br /> <mvt:eval expr="l.attribute"/> <br /> No escape: <mvt:assign name="g.newvar2" value="miva_array_search( l.settings:attributes, 1, l.attribute, l.attribute:template_code EQ g.var)" /> &mvt:global:newvar2; <br /> Quotes: <mvt:assign name="g.newvar3" value="miva_array_search( l.settings:attributes, 1, l.attribute, l.attribute:template_code EQ 'g.var')" /> &mvt:global:newvar3;
 

Basket #25800

[Video Tutorial](http://www.miva.com/videos/web_developers/structures) Structures are a lot like arrays.
Created: 1474566170
View "Basket #25800"
<mvt:assign name="g.foo" value="'bar'" /> &mvte:global:foo; <mvt:assign name="l.settings:example:foo" value="'bar'" /> <mvt:assign name="l.settings:example:bar" value="'baz'" /> &mvt:example:foo;<br> &mvt:example:bar;<br> <hr> <mvt:assign name="l.settings:example:list[0]" value="'Bananas'" /> <mvt:assign name="l.settings:example:list[1]" value="'Milk'" /> <mvt:assign name="l.settings:example:list[2]" value="'Bread'" /> <mvt:assign name="l.settings:example:list[3]" value="'Cereal'" /> &mvt:example:list[0];<br> &mvt:example:list[1];<br> &mvt:example:list[2];<br> &mvt:example:list[3];<br> <br> <mvt:foreach iterator="item" array="example:list"> &mvt:item;<br> </mvt:foreach> <hr> <mvt:assign name="l.settings:example:states[3]:abbr" value="'CA'" /> <mvt:assign name="l.settings:example:states[3]:name" value="'California'" /> <mvt:assign name="l.settings:example:states[1]:abbr" value="'FL'" /> <mvt:assign name="l.settings:example:states[1]:name" value="'Florida'" /> <mvt:assign name="l.settings:example:states[2]:abbr" value=" 'MD' " /> <mvt:assign name="l.settings:example:states[2]:name" value=" 'Maryland' " /> &mvt:example:states[3]:abbr; - &mvt:example:states[3]:name;<br> &mvt:example:states[1]:abbr; - &mvt:example:states[1]:name;<br> <br> <mvt:foreach iterator="state" array="example:states"> &mvt:state:abbr; - &mvt:state:name;<br> </mvt:foreach> <hr> <h4>Print Example Structure:</h4> <mvt:eval expr="decodeattribute(glosub(miva_array_serialize(l.settings:example), ',', '<br>'))" />
 

Basket #24013

[Video Tutorial](http://www.miva.com/videos/web_developers/structures) Structures are a lot like arrays.
Created: 1470756520
View "Basket #24013"
<mvt:assign name="l.settings:example:foo" value="'bar'" /> <mvt:assign name="l.settings:example:bar" value="'baz'" /> <mvt:assign name="g.example" value="'test'" /> &mvt:global:example:foo;<br> &mvt:example:bar;<br> <hr> <mvt:assign name="l.settings:example:list[0]" value="'Bananas'" /> <mvt:assign name="l.settings:example:list[1]" value="'Milk'" /> <mvt:assign name="l.settings:example:list[2]" value="'Bread'" /> <mvt:assign name="l.settings:example:list[3]" value="'Cereal'" /> &mvt:example:list[0];<br> &mvt:example:list[1];<br> &mvt:example:list[2];<br> &mvt:example:list[3];<br> <br> Array loop: <mvt:foreach iterator="item" array="example:list"> &mvt:item;<br> </mvt:foreach> <hr> &mvt:item; <---sdflkjsdf <br /> miva array elements:<mvt:eval expr="miva_array_elements(l.settings:example:list)" /> <hr /> <mvt:assign name="l.settings:success" value="glosub( 'this is a test', 'test', 'testing' )" /> &mvt:success; <hr /> <mvt:assign name="l.settings:example:states[0]:abbr" value="'CA'" /> <mvt:assign name="l.settings:example:states[0]:name" value="'California'" /> <mvt:assign name="l.settings:example:states[1]:abbr" value="'FL'" /> <mvt:assign name="l.settings:example:states[1]:name" value="'Florida'" /> <mvt:assign name="l.settings:example:states[1]:otherstuff[1]:test" value="'tesasfsdgfwert'" /> &mvt:example:states[0]:abbr; - &mvt:example:states[0]:name;<br> &mvt:example:states[1]:abbr; - &mvt:example:states[1]:name;<br> <br> <mvt:foreach iterator="state" array="example:states"> &mvt:state:abbr; - &mvt:state:name;<br> </mvt:foreach> <hr> <h4>Print Example Structure:</h4> <mvt:eval expr="decodeattribute(glosub(miva_array_serialize(l.settings:example), ',', '<br>'))" />
 
View "Basket #19987"
<mvt:foreach iterator="data" array="imagedata"> Image Data:<br> &mvt:data:image:id;<br> &mvt:data:image:height;<br> &mvt:data:image:width;<br> &mvt:data:image:image;<br> &mvt:data:image:refcount;<br> ImageType Data:<br> &mvt:data:imagetype:code;<br> &mvt:data:imagetype:descrip;<br> </mvt:foreach>
 

Basket #19784

Created: 1469229294
View "Basket #19784"
<mvt:assign name="l.settings:list[1]" value="'bananas'" /> <mvt:assign name="l.settings:list[2]" value="'bananas'" /> <mvt:assign name="l.settings:list[3]" value="'carrots'" /> <mvt:assign name="l.settings:list[4]" value="'bananas'" /> <mvt:assign name="l.settings:list[5]" value="'carrots'" /> <mvt:assign name="l.settings:list[6]" value="'bananas'" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach> <mvt:do file="g.module_library_utilities" name="l.null" value="QuickSortArray(l.settings:list, '', -1)" /> <h2>After</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach>
 

Basket #19555

Example of Miva_array_Delete
Created: 1468365919
View "Basket #19555"
<mvt:assign name="l.settings:my_array" value="miva_array_deserialize( 'one,two,three,four,five,six' )" /> <mvt:eval expr="l.settings:my_array" /> ~~~ <mvt:eval expr="miva_array_delete( l.settings:my_array, 6, 1 )" /> ~~~ <mvt:eval expr="l.settings:my_array" />
 
View "Basket #19297"
<mvt:assign name="l.fruit" value="'banana,apple,peach'"/> <mvt:assign name="l.settings:fruits" value="miva_array_deserialize( l.fruit )"/> <mvt:foreach iterator="fruit" array="fruits"> &mvt:fruit;<br> </mvt:foreach>
 

Basket #18999

Created: 1467387891
View "Basket #18999"
<mvt:assign name="g.api_key" value="'http://www.shoppopdisplays.com/mm5/5.00/modules/component/mailchimp.mvc?action=subscribe&api_key=BF1AexYORDY3VA12AQBRaS0CVw1zE0N8Xwk2Q303Qk5uTAUISg==&id=6805f1ce57&email_address=test@aol.com&merge_vars[FNAME]=&merge_vars[LNAME]=&output=json'" /> <mvt:assign name="g.api_key" value="gettoken(g.api_key, '&', 2)" /><br> &mvt:global:api_key; <mvt:assign name="g.api_key" value="gettoken(g.api_key, 'api', 2)" /><br> &mvt:global:api_key;
 

Basket #18598

 arrays
Created: 1466181914
View "Basket #18598"
<MvCOMMENT> Create a dataset <MvCOMMENT> <MvASSIGN NAME="g.names" VALUE="January,February,March,April,May,June,July,August,September,October,November,December"> <MvASSIGN NAME="g.abbr" VALUE="Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec"> <MvCOMMENT> Convert the data to an array structure. <MvCOMMENT> <MvASSIGN NAME="g.posn" VALUE="{ 1 }"> <MvWHILE EXPR="{ g.posn LE 12 }"> <MvASSIGN NAME="g.month" INDEX="{ g.posn }" MEMBER="name" VALUE="{ gettoken(g.names,',',g.posn) }"> <MvASSIGN NAME="g.month" INDEX="{ g.posn }" MEMBER="abbr" VALUE="{ gettoken(g.abbr,',',g.posn) }"> <MvASSIGN NAME="g.month" INDEX="{ g.posn }" MEMBER="first_date" VALUE="{ g.month[g.posn]:name $ ' 1, ' $ s.tm_year }"> <MvCOMMENT> Next item <MvCOMMENT> <MvASSIGN NAME="g.posn" VALUE="{ g.posn + 1 }"> </MvWHILE>
 

Make unique array

Created: 1465407480
View "Make unique array"
<mvt:assign name="g.array1" value="miva_array_deserialize( '1,2,3,4,5,6,7' )" /> <mvt:assign name="g.array2" value="miva_array_deserialize( '4,5,6,7' )" /> <mvt:assign name="g.uniqueHolder" value="''" /> <mvt:foreach iterator="number" array="global:array1"> <mvt:if expr="NOT miva_array_find(l.settings:number, g.uniqueHolder, 0)"> <mvt:assign name="l.array_length" value="miva_array_insert( g.uniqueHolder, l.settings:number, -1 )" /> </mvt:if> </mvt:foreach> <mvt:assign name="g.mvt_debug" value="miva_array_serialize( g.uniqueHolder )" /> &mvt:global:mvt_debug;
 

Miva Array Delete Example

Example of Miva_array_Delete
Created: 1461693242
View "Miva Array Delete Example"
<mvt:assign name="l.settings:my_array" value="miva_array_deserialize( 'one,two,three,four,five,six' )" /> <mvt:eval expr="l.settings:my_array" /> ~~~ <mvt:eval expr="miva_array_delete( l.settings:my_array, 6, 1 )" /> ~~~ <mvt:eval expr="l.settings:my_array" />
 
View "miva_array_search()"
<mvt:assign name="l.settings:attributes[1]:template_code" value="'size'" /> <mvt:assign name="l.settings:attributes[1]:prompt" value="'Select a Size:'" /> <mvt:assign name="l.settings:attributes[2]:template_code" value="'color'" /> <mvt:assign name="l.settings:attributes[2]:prompt" value="'Select a Color:'" /> <mvt:assign name="l.settings:attributes[3]:template_code" value="'foo'" /> <mvt:assign name="l.settings:attributes[3]:prompt" value="'Foo Bar:'" /> <mvt:assign name="l.settings:attributes[4]:template_code" value="'baz'" /> <mvt:assign name="l.settings:attributes[4]:prompt" value="'Baz!:'" /> <mvt:assign name="g.var" value="'foo'" /> POS: <mvt:eval expr="miva_array_search( l.settings:attributes, 1, l.attribute, 'l.attribute:template_code EQ \'' $ g.var $ '\'' )" /> <mvt:eval expr="l.attribute"/>
 
View "miva_array_search()"
<mvt:assign name="l.settings:attributes[1]:template_code" value="'size'" /> <mvt:assign name="l.settings:attributes[1]:prompt" value="'Select a Size:'" /> <mvt:assign name="l.settings:attributes[2]:template_code" value="'color'" /> <mvt:assign name="l.settings:attributes[2]:prompt" value="'Select a Color:'" /> <mvt:assign name="l.settings:attributes[3]:template_code" value="'foo'" /> <mvt:assign name="l.settings:attributes[3]:prompt" value="'Foo Bar:'" /> <mvt:assign name="g.var" value="'foo'" /> POS: <mvt:eval expr="miva_array_search( l.settings:attributes, 1, l.attribute, 'l.attribute:template_code EQ \'' $ g.var $ '\'' )" /> <mvt:eval expr="l.attribute"/>
 
View "miva_array_search()"
<mvt:assign name="l.settings:attributes[1]:template_code" value="'size'" /> <mvt:assign name="l.settings:attributes[1]:prompt" value="'Select a Size:'" /> <mvt:assign name="l.settings:attributes[2]:template_code" value="'color'" /> <mvt:assign name="l.settings:attributes[2]:prompt" value="'Select a Color:'" /> <mvt:assign name="l.settings:attributes[3]:template_code" value="'foo'" /> <mvt:assign name="l.settings:attributes[3]:prompt" value="'Foo Bar:'" /> <mvt:assign name="g.var" value="'foo'" /> POS: <mvt:eval expr="miva_array_search( l.settings:attributes, 1, l.attribute, 'l.attribute:template_code EQ \'' $ g.var $ '\'' )" /> <mvt:eval expr="l.attribute"/>
 
View "miva_array_search()"
<mvt:assign name="l.settings:attributes[1]:template_code" value="'size'" /> <mvt:assign name="l.settings:attributes[1]:prompt" value="'Select a Size:'" /> <mvt:assign name="l.settings:attributes[2]:template_code" value="'color'" /> <mvt:assign name="l.settings:attributes[2]:prompt" value="'Select a Color:'" /> <mvt:assign name="l.settings:attributes[2]:template_code" value="'foo'" /> <mvt:assign name="l.settings:attributes[2]:prompt" value="'Foo Bar:'" /> POS: <mvt:eval expr="miva_array_search( l.settings:attributes, 1, l.attribute, 'l.attribute:template_code EQ \'foo\'' )" /> <mvt:eval expr="l.attribute"/>
 

Snippet: 1457561901 - v2

looping global array
Created: 1457562531
View "Snippet: 1457561901 - v2"
<mvt:assign name="g.test[1]" value="'test1'" /> <mvt:assign name="g.test[2]" value="'test2'" /> <mvt:assign name="g.test[3]" value="'test3'" /> <mvt:foreach iterator="teststr" array="global:test"> &mvt:teststr; </mvt:foreach>
 
View "Sort One Dimensional Array"
<mvt:assign name="l.settings:list[1]" value="'apples'" /> <mvt:assign name="l.settings:list[2]" value="'bananas'" /> <mvt:assign name="l.settings:list[3]" value="'carrots'" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach> <mvt:do file="g.module_library_utilities" name="l.null" value="QuickSortArray(l.settings:list, '', -1)" /> <h2>After</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach>
 
View "Basket #9702"
<mvt:assign name="g.string" value="'123,312,45,656'" /> <mvt:assign name="g.array" value="miva_array_deserialize( g.string )" /> &mvt:global:array[1];<br> &mvt:global:array[2];<br> &mvt:global:array[3];<br> &mvt:global:array[4];<br> <mvt:assign name="l.settings:fields" value="g.array" /> <mvt:assign name="g.fields_join" value="''" /> <mvt:foreach iterator="field" array="fields"> <mvt:if expr="g.fields_join NE ''"> <mvt:assign name="g.fields_join" value ="g.fields_join $ ','" /> </mvt:if> <mvt:assign name="g.fields_join" value="g.fields_join $ l.settings:field" /> </mvt:foreach> &mvt:global:fields_join;
 
View "Basket #7657"
<mvt:assign name="g.test" value="'caleb'" /> <mvt:assign name="g.test" value="NULL" /> when assigned to NULL (g.NULL empty) : &mvt:global:test;</br></br> <mvt:assign name="l.NULL" value="3" /> <mvt:assign name="g.test" value="NULL" /> when assigned to NULL (g.NULL value) : &mvt:global:test;</br></br> <mvt:assign name="g.test" value="''" /> when assigned to empty string: &mvt:global:test;</br></br>
 
View "Split/Explode String into Array"
<mvt:assign name="g.string" value="'1|2|3|4|5'" /> <mvt:assign name="g.delimiter" value="'|'" /> <mvt:do file="g.Module_Library_Utilities" name="l.null" value="SplitString( g.string, g.delimiter, g.array )" /> &mvte:global:array[1];<br> &mvte:global:array[2];<br> &mvte:global:array[3];<br> &mvte:global:array[4];<br> &mvte:global:array[5];<br> <hr/> <mvt:assign name="g.string_again" value="glosub( g.array, ',', '|' )" /> &mvt:global:array;<br> &mvte:global:string_again;<br>
 
View "Split/Explode String into Array"
<mvt:assign name="g.string" value="'1|2|3|4|5'" /> <mvt:assign name="g.delimiter" value="'|'" /> <mvt:do file="g.Module_Library_Utilities" name="l.null" value="SplitString( g.string, g.delimiter, g.output_array )" /> &mvte:global:output_array[1];<br> &mvte:global:output_array[2];<br> &mvte:global:output_array[3];<br> &mvte:global:output_array[4];<br> &mvte:global:output_array[5];<br>
 
View "Split/Explode String into Array"
<mvt:assign name="g.string" value="'1,2,3,4,5'" /> <mvt:assign name="g.array" value="miva_array_deserialize( g.string )" /> &mvt:global:array[1];<br> &mvt:global:array[2];<br> &mvt:global:array[3];<br> &mvt:global:array[4];<br> &mvt:global:array[5];<br>
 
View "Basket #6092"
<mvt:assign name="l.fruit" value="'banana,apple,peach,test'"/> <mvt:assign name="l.settings:fruits" value="miva_array_deserialize( l.fruit )"/> <mvt:foreach iterator="fruit" array="fruits"> &mvt:fruit;<br> </mvt:foreach>
 
View "Assign Array Member Name"
<mvt:assign name="l.member" value="'active'" /> <mvt:assign name="l.value" value="1" /> <mvt:assign name="l.member2" value="'public'" /> <mvt:assign name="l.value2" value="0" /> <mvt:assign name="l.settings:foo" value="miva_array_deserialize( ':' $ l.member $ '=' $l.value $ ',:' $ l.member2 $ '=' $l.value2 )" /> &mvt:foo:active;<br> &mvt:foo:public; <hr/> <mvt:comment><!-- OR --></mvt:comment> <mvt:item name="customfields" param="Read_Product_ID( l.settings:product:id, '', l.settings:fields )" /> <mvt:foreach iterator="field" array="fields"> <mvt:if expr="l.field_string"> <mvt:assign name="l.field_string" value="l.field_string $ ','"/> </mvt:if> <mvt:assign name="l.field_string" value="l.field_string $ ':' $ l.settings:field:code $ '=' $ l.settings:field:value" /> </mvt:foreach> <mvt:assign name="l.settings:product:fields" value="miva_array_deserialize( l.field_string )" />
 
View "Assign Array Member Name"
<mvt:assign name="l.member" value="'active'" /> <mvt:assign name="l.value" value="1" /> <mvt:assign name="l.member2" value="'public'" /> <mvt:assign name="l.value2" value="0" /> <mvt:assign name="l.settings:foo" value="miva_array_deserialize( ':' $ l.member $ '=' $l.value $ ',:' $ l.member2 $ '=' $l.value2 )" /> &mvt:foo:active;<br> &mvt:foo:public; <hr/> <mvt:comment><!-- OR --></mvt:comment> <mvt:item name="customfields" param="Read_Product_ID( l.settings:product:id, '', l.settings:fields )" /> <mvt:foreach iterator="field" array="fields"> <mvt:if expr="l.field_string"> <mvt:assign name="l.field_string" value="l.field_string $ ','"/> </mvt:if> <mvt:assign name="l.field_string" value="l.field_string $ ':' $ l.settings:field:code $ '=' $ l.settings:field:value" /> </mvt:foreach> <mvt:assign name="l.settings:product:fields" value="miva_array_deserialize( l.field_string )" />
 

Arrays

 arrays
Created: 1440022007
View "Arrays"
<mvt:assign name="l.settings:list[1]" value="'Bananas'" /> <mvt:assign name="l.settings:list[2]" value="'Milk'" /> <mvt:assign name="l.settings:list[3]" value="'Bread'" /> <mvt:assign name="l.settings:list[4]" value="'Cereal'" /> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach> <h5>Debug</h5> <mvt:eval expr="decodeattribute(glosub(miva_array_serialize(l.settings:list), ',', '<br>'))" /> <hr> <mvt:assign name="l.settings:states[1]:abbr" value="'CA'" /> <mvt:assign name="l.settings:states[1]:name" value="'California'" /> <mvt:assign name="l.settings:states[2]:abbr" value="'FL'" /> <mvt:assign name="l.settings:states[2]:name" value="'Florida'" /> <mvt:foreach iterator="state" array="states"> &mvt:state:abbr; - &mvt:state:name;<br> </mvt:foreach> <h5>Debug</h5> <mvt:eval expr="decodeattribute(glosub(miva_array_serialize(l.settings:states), ',', '<br>'))" />
 

Basket #4590

[Video Tutorial](http://www.miva.com/videos/web_developers/structures) Structures are a lot like arrays.
Created: 1438905859
View "Basket #4590"
<mvt:assign name="g.foo" value="'bar'" /> <mvt:assign name="l.settings:example:foo" value="'bar'" /> <mvt:assign name="l.settings:example:bar" value="'baz'" /> &mvt:example:foo;<br> &mvt:example:bar;<br> <hr> <mvt:assign name="l.settings:example:list[1]" value="'Bananas'" /> <mvt:assign name="l.settings:example:list[2]" value="'Milk'" /> <mvt:assign name="l.settings:example:list[3]" value="'Bread'" /> <mvt:assign name="l.settings:example:list[4]" value="'Cereal'" /> &mvt:example:list[1];<br> &mvt:example:list[2];<br> &mvt:example:list[3];<br> &mvt:example:list[4];<br> <br> <mvt:foreach iterator="item" array="example:list"> &mvt:item;<br> </mvt:foreach> <hr> <mvt:assign name="l.settings:example:states[0]:abbr" value="'CA'" /> <mvt:assign name="l.settings:example:states[0]:name" value="'California'" /> <mvt:assign name="l.settings:example:states[1]:abbr" value="'FL'" /> <mvt:assign name="l.settings:example:states[1]:name" value="'Florida'" /> &mvt:example:states[0]:abbr; - &mvt:example:states[0]:name;<br> &mvt:example:states[1]:abbr; - &mvt:example:states[1]:name;<br> <br> <mvt:foreach iterator="state" array="example:states"> &mvt:state:abbr; - &mvt:state:name;<br> </mvt:foreach> <hr> <h4>Print Example Structure:</h4> <mvt:eval expr="decodeattribute(glosub(miva_array_serialize(l.settings:example), ',', '<br>'))" />
 
View "Miva Array Deserialize "
<mvt:assign name="l.fruit" value="'banana,apple,peach'"/> <mvt:assign name="l.settings:fruits" value="miva_array_deserialize( l.fruit )"/> <mvt:foreach iterator="fruit" array="fruits"> &mvt:fruit;<br> </mvt:foreach>
 

Basket #1319

[Video Tutorial](http://www.miva.com/videos/web_developers/structures) Structures are a lot like arrays.
Created: 1430861164
View "Basket #1319"
<mvt:assign name="l.serialized" value="':customfields:aromaticScent=Peppermint+Western+U.S.+essential+oil+has+a+fresh%2C+cool%2C+grassy-minty+scent+that+is+cleaner%2C+smoother%2C+and+more+refined+than+Indian+Peppermint.,:customfields:extractionMethod=Steam+Distilled,:customfields:product_type=Essential+Oil,:customfields:size=10+ml+%281%2F3+oz%29,:customfields:strengthOfAroma=Strong'" /> <mvt:assign name="l.serialized" value="l.serialized $ ',:customfields:strengthOfAroma=Weak'" /> <mvt:assign name="l.settings:deserialized" value="miva_array_deserialize( l.serialized )" /> &mvt:deserialized:customfields:strengthOfAroma;
 

Basket #895

[Video Tutorial](http://www.miva.com/videos/web_developers/structures) Structures are a lot like arrays.
Created: 1429558536
View "Basket #895"
<mvt:assign name="l.settings:example:foo" value="'bar'" /> <mvt:assign name="l.settings:example:bar" value="'baz'" /> &mvt:example:foo;<br> &mvt:example:bar;<br> <hr> <mvt:assign name="l.settings:example:list[0]" value="'Bananas'" /> <mvt:assign name="l.settings:example:list[1]" value="'Milk'" /> <mvt:assign name="l.settings:example:list[2]" value="'Bread'" /> <mvt:assign name="l.settings:example:list[3]" value="'Cereal'" /> &mvt:example:list[0];<br> &mvt:example:list[1];<br> &mvt:example:list[2];<br> &mvt:example:list[3];<br> <br> <mvt:foreach iterator="item" array="example:list"> &mvt:item;<br> </mvt:foreach> <hr> <mvt:assign name="l.settings:example:states[0]:abbr" value="'CA'" /> <mvt:assign name="l.settings:example:states[0]:name" value="'California'" /> <mvt:assign name="l.settings:example:states[1]:abbr" value="'FL'" /> <mvt:assign name="l.settings:example:states[1]:name" value="'Florida'" /> &mvt:example:states[0]:abbr; - &mvt:example:states[0]:name;<br> &mvt:example:states[1]:abbr; - &mvt:example:states[1]:name;<br> <br> <mvt:foreach iterator="state" array="example:states"> &mvt:state:abbr; - &mvt:state:name;<br> </mvt:foreach> <hr> <h4>Print Example Structure:</h4> <mvt:eval expr="decodeattribute(glosub(miva_array_serialize(l.settings:example), ',', '<br>'))" />
 

Snippet: 1429558522 - v1

[Video Tutorial](http://www.miva.com/videos/web_developers/structures) Structures are a lot like arrays.
Created: 1429558522
View "Snippet: 1429558522 - v1"
<mvt:assign name="l.settings:example:foo" value="'bar'" /> <mvt:assign name="l.settings:example:bar" value="'baz'" /> &mvt:example:foo;<br> &mvt:example:bar;<br> <hr> <mvt:assign name="l.settings:example:list[0]" value="'Bananas'" /> <mvt:assign name="l.settings:example:list[1]" value="'Milk'" /> <mvt:assign name="l.settings:example:list[2]" value="'Bread'" /> <mvt:assign name="l.settings:example:list[3]" value="'Cereal'" /> &mvt:example:list[0];<br> &mvt:example:list[1];<br> &mvt:example:list[2];<br> &mvt:example:list[3];<br> <br> <mvt:foreach iterator="item" array="example:list"> &mvt:item;<br> </mvt:foreach> <hr> <mvt:assign name="l.settings:example:states[0]:abbr" value="'CA'" /> <mvt:assign name="l.settings:example:states[0]:name" value="'California'" /> <mvt:assign name="l.settings:example:states[1]:abbr" value="'FL'" /> <mvt:assign name="l.settings:example:states[1]:name" value="'Florida'" /> &mvt:example:states[0]:abbr; - &mvt:example:states[0]:name;<br> &mvt:example:states[1]:abbr; - &mvt:example:states[1]:name;<br> <br> <mvt:foreach iterator="state" array="example:states"> &mvt:state:abbr; - &mvt:state:name;<br> </mvt:foreach> <hr> <h4>Print Example Structure:</h4> <mvt:eval expr="decodeattribute(glosub(miva_array_serialize(l.settings:example), ',', '<br>'))" />
 

Basket #454

[Video Tutorial](http://www.miva.com/videos/web_developers/structures) Structures are a lot like arrays.
Created: 1427408414
View "Basket #454"
<mvt:assign name="l.settings:example:foo" value="'bar'" /> <mvt:assign name="l.settings:example:bar" value="'baz'" /> &mvt:example:foo;<br> &mvt:example:bar;<br> <hr> <mvt:assign name="l.settings:example:list[0]" value="'Bananas'" /> <mvt:assign name="l.settings:example:list[1]" value="'Milk'" /> <mvt:assign name="l.settings:example:list[2]" value="'Bread'" /> <mvt:assign name="l.settings:example:list[3]" value="'Cereal'" /> &mvt:example:list[1];<br> <br> <mvt:foreach iterator="item" array="example:list"> &mvt:item;<br> </mvt:foreach> <hr> <mvt:assign name="l.settings:example:states[0]:abbr" value="'CA'" /> <mvt:assign name="l.settings:example:states[0]:name" value="'California'" /> <mvt:assign name="l.settings:example:states[1]:abbr" value="'FL'" /> <mvt:assign name="l.settings:example:states[1]:name" value="'Florida'" /> &mvt:example:states[0]:abbr; - &mvt:example:states[0]:name;<br> &mvt:example:states[1]:abbr; - &mvt:example:states[1]:name;<br> <br> <mvt:foreach iterator="state" array="example:states"> &mvt:state:abbr; - &mvt:state:name;<br> </mvt:foreach> <hr> <h4>Print Example Structure:</h4> <mvt:eval expr="decodeattribute(glosub(miva_array_serialize(l.settings:example), ',', '<br>'))" />
 

Basket #447

[Video Tutorial](http://www.miva.com/videos/web_developers/structures) Structures are a lot like arrays.
Created: 1427395253
View "Basket #447"
<mvt:assign name="l.settings:example:foo" value="'bar'" /> <mvt:assign name="l.settings:example:bar" value="'baz'" /> &mvt:example:foo;<br> &mvt:example:bar;<br> <hr> <mvt:assign name="l.settings:example:list[0]" value="'Bananas'" /> <mvt:assign name="l.settings:example:list[1]" value="'Milk'" /> <mvt:assign name="l.settings:example:list[2]" value="'Bread'" /> <mvt:assign name="l.settings:example:list[3]" value="'Cereal'" /> &mvt:example:list[0];<br> &mvt:example:list[1];<br> &mvt:example:list[2];<br> &mvt:example:list[3];<br> <br> <mvt:foreach iterator="item" array="example:list"> &mvt:item;<br> </mvt:foreach> <hr> <mvt:assign name="l.settings:example:states[0]:abbr" value="'CA'" /> <mvt:assign name="l.settings:example:states[0]:name" value="'California'" /> <mvt:assign name="l.settings:example:states[1]:abbr" value="'FL'" /> <mvt:assign name="l.settings:example:states[1]:name" value="'Florida'" /> &mvt:example:states[0]:abbr; - &mvt:example:states[0]:name;<br> &mvt:example:states[1]:abbr; - &mvt:example:states[1]:name;<br> <br> <mvt:foreach iterator="state" array="example:states"> &mvt:state:abbr; - &mvt:state:name;<br> </mvt:foreach> <hr> <h4>Print Example Structure:</h4> <mvt:eval expr="decodeattribute(glosub(miva_array_serialize(l.settings:example), ',', '<br>'))" />
 
View "Basket #315"
<mvt:assign name="g.string" value="'1600cc'" /> <mvt:assign name="g.search" value="'cc'" /> <mvt:assign name="g.foo" value="indexof( g.search, g.string, 1 )" /> &mvte:global:foo;
 

Structures

[Video Tutorial](http://www.miva.com/videos/web_developers/structures) Structures are a lot like arrays.
Created: 1427238160
View "Structures"
<mvt:assign name="l.settings:example:foo" value="'bar'" /> <mvt:assign name="l.settings:example:bar" value="'baz'" /> &mvt:example:foo;<br> &mvt:example:bar;<br> <hr> <mvt:assign name="l.settings:example:list[0]" value="'Bananas'" /> <mvt:assign name="l.settings:example:list[1]" value="'Milk'" /> <mvt:assign name="l.settings:example:list[2]" value="'Bread'" /> <mvt:assign name="l.settings:example:list[3]" value="'Cereal'" /> &mvt:example:list[0];<br> &mvt:example:list[1];<br> &mvt:example:list[2];<br> &mvt:example:list[3];<br> <br> <mvt:foreach iterator="item" array="example:list"> &mvt:item;<br> </mvt:foreach> <hr> <mvt:assign name="l.settings:example:states[0]:abbr" value="'CA'" /> <mvt:assign name="l.settings:example:states[0]:name" value="'California'" /> <mvt:assign name="l.settings:example:states[1]:abbr" value="'FL'" /> <mvt:assign name="l.settings:example:states[1]:name" value="'Florida'" /> &mvt:example:states[0]:abbr; - &mvt:example:states[0]:name;<br> &mvt:example:states[1]:abbr; - &mvt:example:states[1]:name;<br> <br> <mvt:foreach iterator="state" array="example:states"> &mvt:state:abbr; - &mvt:state:name;<br> </mvt:foreach> <hr> <h4>Print Example Structure:</h4> <mvt:eval expr="decodeattribute(glosub(miva_array_serialize(l.settings:example), ',', '<br>'))" />