Using IF Statement with Ordering Options

General ShopSite user discussion

Using IF Statement with Ordering Options

Postby rasbro » Thu Apr 12, 2007 3:27 pm

I am trying to use an IF statement with ordering options, but I can't seem to find a reliable tag to use. Here is an example of what I am currently doing:

[-- IF PRODUCT.DisplayOrderingOptions --]
<div id="skucart-options">
[-- IF PRODUCT.OptionText --]
<span class="options-desc">[-- PRODUCT.OptionText --]</span>
[-- ELSE --]
<span class="options-desc">Please Select Option(s):</span>
[-- END_IF --]
<div class="options-menu">[-- Order_Option_Menu Column SKU --]</div>
</div>
[-- END_IF --]

The problem with this is that all my product more info pages have the Display Ordering Options selected so that it shows up on the product page and not just in the cart, which means that this tag is not reliable to base an IF statement on for something like my own options text to appear if one is not specified in the Options Text field.

Right now the text "Please Select Option(s):" appears on all pages whether there are ordering options or not.

Any ideas of what tag I can use? If there was a tag for Option Menu Text then that would be perfect since my text would only show up if there are any options entered into the Option Menu Text field. I can't even think of a way to use a VAR tag with this. ??

Thanks for any ideas you have!
Brian

Saturn Coast Technologies
www.saturncoast.com
rasbro
 
Posts: 12
Joined: Tue Jan 23, 2007 11:57 am

Postby Jim » Thu Apr 12, 2007 3:50 pm

If a field is a check box you need to use "checked" (with quote marks) in the if statement. So your line
[-- IF PRODUCT.DisplayOrderingOptions --]
should be
[-- IF PRODUCT.DisplayOrderingOptions "checked" --]
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Postby rasbro » Thu Apr 12, 2007 4:10 pm

Ahhhh... now that is something new I didn't know. Makes sense. I appreciate the tip on that but I guess I am still at the same dilemma as before.

Is there another tag I can use or a better way to trigger "IF" there is any text in the Option Menu Text field?
Brian

Saturn Coast Technologies
www.saturncoast.com
rasbro
 
Posts: 12
Joined: Tue Jan 23, 2007 11:57 am

Postby rasbro » Thu Apr 12, 2007 5:33 pm

Never mind on that last reply of mine. I realize now that instead of having the Display Ordering Options field checked for all products, I should only have it checked for those products I have a list of options for. I don't know why I did that but now this will cause the IF statement to work correctly.

Thanks again Jim for the tip on including the value "checked" in the tag!
Brian

Saturn Coast Technologies
www.saturncoast.com
rasbro
 
Posts: 12
Joined: Tue Jan 23, 2007 11:57 am


Return to User Forum

Who is online

Users browsing this forum: No registered users and 106 guests