"QuickSortArray" Snippets


Basket #68419

Created: 1510073364
View "Basket #68419"
<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 #51757

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

Basket #52340

Created: 1501171214
View "Basket #52340"
<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 #52331

Created: 1501002842
View "Basket #52331"
<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, '', 0)" /> <h2>After</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach>
 

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>
 

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 #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 #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 #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 #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;
 
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>