Back

How to Add Select One To Your Drop-Down Menus With Attribute Machine

Read on to learn more...

By Miva | October 14, 2011
Man smiling and looking at a tablet

Share

  

Want to read this blog offline?

No worries, download the PDF version now and enjoy your reading later...

Download PDF

PR8 has a lot of unique features and functionalities that storeowners and developers can use to customize their Miva Merchant ecommerce stores. This tutorial will show you how to add “Select One” to each of your drop down lists and still use Attribute Machine to track inventory down to the attribute level.

1. Enable “Select One” Inside Of Attribute Machine

Since Attribute Machine dynamically rewrites all the attributes on the page, depending on what the customer selects, it first needs to know if your attributes are going to contain “Select One” as their first option. This will enable Attribute Machine to work as expected and the “Select One” option to still appear in the list.

Go to Pages then click edit for the PROD page. Next click on the Attribute Machine tab on the right hand side.

Here you want to change the Initial Attribute State to be “Preload – Drop-Down Lists Contain Select One”

2. Add “Select One” To Your Product Attribute Template

You will need to manually modify your attribute template on the PROD page to include the select one as the first option for all attributes.

On the same PROD page click over to the Product Attribute Template tab.  Scroll down about ¾ of the page look for this code:

 
<mvt:elseif expr="( l.settings:attribute:type EQ 'select' ) OR ( l.settings:attribute:type EQ 'swatch-select' )">
    <select name="Product_Attributes[&mvt:attribute:index;]:value">
        <mvt:foreach iterator="option" array="attribute:options">
        <mvt:if 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> </mvt:foreach> </select>

Add the “Select One Option” right below the opening “Select Tag” and hit update:

<select name="Product_Attributes[&mvt:attribute:index;]:value">
<option value="">Select One</option>  

Any product with drop-downs will now default to Select One and disable the Add To Cart Button so the customer cannot add the product to the cart until they select a valid combination of attributes.

The Future Economy Whitepaper

Love it? Share it!

  •  
  •  
  •  
  •  
Back to top

Author's Bio

Miva

Miva offers a flexible and adaptable ecommerce platform that evolves with businesses and allows them to drive sales, maximize average order value, cut overhead costs, and increase revenue. Miva has been helping businesses realize their ecommerce potential for over 20 years and empowering retail, wholesale, and direct-to-consumer sellers across all industries to transform their business through ecommerce.

More Posts Like This

Stay in the Loop

Sign up to receive the latest in ecommerce news, articles, whitepapers, and more.

OR CALL 800.608.MIVA

  • Facebook icon
  • Twitter icon
  • Instagram icon
  • LinkedIn icon