I can use some help with this foreach loop. I'll comment to show what I think should be happening but it isn't.
So this is what I think I'm doing
Why the gymnastics? I want to hide all shipping methods if the 'Mohawk' flat rate shipping is returned. The COD method - which is re-purposed Miva flat rate set to 0.00 for people who pick up at our warehouse. In this case Mohawk charges us $89 no matter what (using their trucks) so if a customer picks up at our warehouse they still have to pay. We don't want people selecting the $0 option.
Information
We are using KingWebMaster's Advanced Shipping Manager for shipping. We use Miva's flat rate shipping module for the single COD/Pickup at warehouse $0.00 option.
Problems
-The Miva shipping method rules do not work to exclude the COD/Pickup method, neither the EXCLUDES nor EXCLUDED BY.
-The Advanced Shipping Manager returns the methods names as ADVANCEDSHIPPING:1 to ADVANCEDSHIPPING:(total number of methods). These method names are not always the same (depending on number of relevant shipping methods returned) given parameters (weight, LTL or ground, Lift gate or not etc). So 'Standard Ground' could be ADVANCEDSHIPPING:3 one time and ADVANCEDSHIPPING:1 another or not returned at all if the total weight makes it an LTL shipment.
Notes
We are working with Miva towards a new site design over the next 6 months. In the meantime I just want to make sure that the Warehouse Pickup $0.00 (re-purposed COD using Miva flat rate shipping) is not visible if Mohawk Shipping is the shipping option.
If the customer adds the floor tile product that qualifies for the 'Mohawk' shipping method all methods are hidden EXCEPT the warehouse pickup/COD.
I tried creating the method in Advanced Shipping Manager but still cannot EXCLUDE with Shipping Rules.
Thanks.
Code:
<select name="PaymentMethod" onchange="selOnAcctCheck(this);" > <option value="">Select Payment Option</option> <mvt:foreach array="paymentmethods" iterator="method"> <mvt:if expr="NOT ('Mohawk' CIN l.settings:method:name)"> <mvt:if expr="l.settings:method:code EQ 'COD'"> <option value="&mvte:method:module;:&mvte:method:code;" id="selOnAcct">On Account</option> </mvt:if> <mvt:else> <option value="&mvte:method:module;:&mvte:method:code;">&mvt:method:name;</option> </mvt:if> </mvt:foreach> </select>
Code:
<mvt:foreach array="paymentmethods" iterator="method"> * Loop through array <mvt:if expr="NOT ('Mohawk' CIN l.settings:method:name)"> * If the method does NOT contain 'Mohawk' in the method name * then execute the following IF statement which * checks to see if the method is EQ to COD * if it is it adds an ID <mvt:if expr="l.settings:method:code EQ 'COD'"> <option value="&mvte:method:module;:&mvte:method:code;" id="selOnAcct">On Account</option> </mvt:if> * ELSE exit the IFNOT 'Mohawk' condition (so if its gets here sole remaining method should be 'Mohawk') * which we want to show. <mvt:else> <option value="&mvte:method:module;:&mvte:method:code;">&mvt:method:name;</option> </mvt:if>
Why the gymnastics? I want to hide all shipping methods if the 'Mohawk' flat rate shipping is returned. The COD method - which is re-purposed Miva flat rate set to 0.00 for people who pick up at our warehouse. In this case Mohawk charges us $89 no matter what (using their trucks) so if a customer picks up at our warehouse they still have to pay. We don't want people selecting the $0 option.
Information
We are using KingWebMaster's Advanced Shipping Manager for shipping. We use Miva's flat rate shipping module for the single COD/Pickup at warehouse $0.00 option.
Problems
-The Miva shipping method rules do not work to exclude the COD/Pickup method, neither the EXCLUDES nor EXCLUDED BY.
-The Advanced Shipping Manager returns the methods names as ADVANCEDSHIPPING:1 to ADVANCEDSHIPPING:(total number of methods). These method names are not always the same (depending on number of relevant shipping methods returned) given parameters (weight, LTL or ground, Lift gate or not etc). So 'Standard Ground' could be ADVANCEDSHIPPING:3 one time and ADVANCEDSHIPPING:1 another or not returned at all if the total weight makes it an LTL shipment.
Notes
We are working with Miva towards a new site design over the next 6 months. In the meantime I just want to make sure that the Warehouse Pickup $0.00 (re-purposed COD using Miva flat rate shipping) is not visible if Mohawk Shipping is the shipping option.
If the customer adds the floor tile product that qualifies for the 'Mohawk' shipping method all methods are hidden EXCEPT the warehouse pickup/COD.
I tried creating the method in Advanced Shipping Manager but still cannot EXCLUDE with Shipping Rules.
Thanks.
Comment