2

Folks:

I've got a complicated setup where I can't use the standard Store shipping options. Instead, shipping options need to be stored as price modifiers. The only SKU that will be generated for a product is for these shipping options and they can only select one. For example, if they select Canada, the SKU is can. If they select France, the SKU is France.

Now, for Canada, tax needs to be applied so users have to go through an extra step. I would like to evaluate if the SKU is can. If yes, they are redirected to a new page where they select their province (taxes vary by province).

For the life of me, I can't seem to get the eval working. The SKU is clearly there and changes if I change the country. I can even trace the SKU as can or france or whatever. But the if statement doesn't actually do anything. The code:

{if {sku}==can}
    {redirect="store/step_1a"}
{/if}

{if {sku}!=can}
    {redirect="store/step_2"}
{/if}

This is just one variation. I've tried with quotes and without. I've used NSM Transplant (http://ee-garage.com/nsm-transplant) to isolate the SKU and use the results from that. Still no go.

Any assistance would be appreciated.

1

Definitely needs to look like this:

SKU is {sku}.

{if "{sku}" == "can"}
    {redirect="store/step_1a"}
{/if}

{if "{sku}" != "can"}
    {redirect="store/step_2"}
{/if}

If this isn't working and {sku} is displaying correctly in the above code, then you have a parsing issue, whereby the conditionals are being parsed before the {sku}. In that case, please provide the surrounding code to see how you're outputting the {sku}.

| improve this answer | |
  • Looking like this might not actually work (but not because of your code). As each product has multiple shipping options (15 - 20), assigning a unique SKU to each of those would be pretty crazy since there are over 20 products. Looks like I'm back to the drawing board. But the parsing order might be an issue for other solutions so thanks for that. Sorry for the trouble. – Wonko Aug 13 '13 at 19:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.