I am trying to write some code to conditionally display some text on OSEL if Priority Mail Flat Rate Box is one of the shipping options presented to the customer. Using Toolbelt varlist I see:
OK, so I should be able to iterate over the array to test for the presence of the Flat Rate Box. For instance, code = PRIORITYFL.
I have tried every combination I can think of, but cannot get it to return the list of codes, names, etc.
...yields nothing. Same for:
And a whole host of other attempts.
Oddly, this retrieves something -- I think the shipping method selected on page submittal:
But I can get nothing else out of it. Any ideas how to do this? Thanks.
Kevin Garrett
Code:
l.all_settings:shippingmethods[1]:code &mvt:shippingmethods[1]:code; PARCEL l.all_settings:shippingmethods[1]:formatted_price &mvt:shippingmethods[1]:formatted_price; $12.09 l.all_settings:shippingmethods[1]:module &mvt:shippingmethods[1]:module; mvusps l.all_settings:shippingmethods[1]:name &mvt:shippingmethods[1]:name; U.S.P.S. Parcel Post l.all_settings:shippingmethods[1]:price &mvt:shippingmethods[1]:price; 12.09 l.all_settings:shippingmethods[2]:code &mvt:shippingmethods[2]:code; PRIORITY l.all_settings:shippingmethods[2]:formatted_price &mvt:shippingmethods[2]:formatted_price; $16.70 l.all_settings:shippingmethods[2]:module &mvt:shippingmethods[2]:module; mvusps l.all_settings:shippingmethods[2]:name &mvt:shippingmethods[2]:name; U.S.P.S. Priority Mail l.all_settings:shippingmethods[2]:price &mvt:shippingmethods[2]:price; 16.7 l.all_settings:shippingmethods[3]:code &mvt:shippingmethods[3]:code; PRIORITYFL l.all_settings:shippingmethods[3]:formatted_price &mvt:shippingmethods[3]:formatted_price; $15.45 l.all_settings:shippingmethods[3]:module &mvt:shippingmethods[3]:module; mvusps l.all_settings:shippingmethods[3]:name &mvt:shippingmethods[3]:name; U.S.P.S. Priority Mail Large Flat Rate Box l.all_settings:shippingmethods[3]:price &mvt:shippingmethods[3]:price; 15.45
I have tried every combination I can think of, but cannot get it to return the list of codes, names, etc.
Code:
<mvt:foreach iterator="shippingmethods" array="l.all_settings:shippingmethods"> Test: &mvt:shippingmethods:code; <br> </mvt:foreach>
Code:
<mvt:foreach iterator="shippingmethods" array="shippingmethods"> <mvt:foreach iterator="code" array="shippingmethods:code"> <mvt:foreach iterator="code" array="l.all_settings:shippingmethods:code">
Oddly, this retrieves something -- I think the shipping method selected on page submittal:
Code:
<mvt:foreach iterator="method" array="shippingmethods"> Test: &mvt:method:name; <br> </mvt:foreach>
Kevin Garrett
Comment