Announcement

Collapse
No announcement yet.

unselected attribute in basket

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    unselected attribute in basket

    I have a drop-down attribute that is not required and has no option selected as the default. The first option code is 'none' and the prompt is 'Select One'. If the customer does not select an option the attribute still shows up in the basket. Any way to stop the attribute from showing in the basket if no selection has been made?
    Gary

    [email protected]
    www.icCommerce.com

    #2
    Re: unselected attribute in basket

    well, you need to have a null value for the option "Select One". I believe the only way to do this is via the attribute template using a conditional like:

    Code:
    <mvt:foreach iterator="option" array="attribute:options">
    <mvt:if expr="l.settings:option:prompt EQ 'Select One'">
       <option value="" selected>&mvte:option:prompt;</option>
    <mvt:elseif expr="( ( g.Product_Attributes[l.settings:attribute:index]:value EQ 0 ) AND ( l.settings:option:id EQ l.settings:attribute:default_id ) ) OR ( g.Product_Attributes[l.settings:attribute:index]:value EQ l.settings:option:code )">
       <option value="&mvte:option:code;" selected>&mvte:option:prompt;</option>
    <mvt:else>
       <option value="&mvte:option:code;">&mvte:option:prompt;</option>
    </mvt:if>
    Bruce Golub
    Phosphor Media - "Your Success is our Business"

    Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
    phosphormedia.com

    Comment


      #3
      Re: unselected attribute in basket

      Works perfectly, thanks.
      Gary

      [email protected]
      www.icCommerce.com

      Comment

      Working...
      X