

<?xml version="1.0" encoding="UTF-8"?>
	<rss version="2.0"
		xmlns:content="http://purl.org/rss/1.0/modules/content/"
		xmlns:wfw="http://wellformedweb.org/CommentAPI/"
		xmlns:dc="http://purl.org/dc/elements/1.1/"
		xmlns:atom="http://www.w3.org/2005/Atom"

			>

	<channel>
		<title>LexiConn News  &#187;  Topic: ShopSite Tutorial: Restricting Ordering Options</title>
		<atom:link href="https://support.lexiconn.com/news/forums/topic/shopsite-tutorial-restricting-ordering-options/feed" rel="self" type="application/rss+xml" />
		<link>https://support.lexiconn.com/news/forums/topic/shopsite-tutorial-restricting-ordering-options/feed</link>
		<description></description>
		<pubDate>Mon, 06 Apr 2026 03:27:29 +0000</pubDate>
		<generator>http://bbpress.org/?v=2.5.3-5249</generator>
		<language>en-US</language>

		
														
					
				<item>
					<guid>https://support.lexiconn.com/news/forums/topic/shopsite-tutorial-restricting-ordering-options/#post-48689</guid>
					<title><![CDATA[ShopSite Tutorial: Restricting Ordering Options]]></title>
					<link>https://support.lexiconn.com/news/forums/topic/shopsite-tutorial-restricting-ordering-options/#post-48689</link>
					<pubDate>Thu, 30 Jul 2009 19:17:24 +0000</pubDate>
					<dc:creator>Anonymous</dc:creator>

					<description>
						<![CDATA[
						<p>Ordering options provide you with an easy method to create variations on products in ShopSite, and &#8220;Special Rules&#8221; provides a simple, yet powerful way to specify price and availability for each option.</p>
<p>For example, appending &#8220;;+2&#8243; to an option will add $2.00 to the product&#8217;s base price for this option while appending &#8220;;*2&#8243; will double the base price for this option.</p>
<table>
<tbody>
<tr>
<td bgcolor="#cccc99"><span style="font-family: verdana,arial,helvetica; font-size: xx-small;">Order Options Description:</span></td>
<td bgcolor="#ffffcc"><span style="font-family: verdana,arial,helvetica; font-size: xx-small;"><span style="font-family: verdana,arial,helvetica; font-size: xx-small;"><br />
</span></span></p>
<table border="1" width="270" align="top">
<tbody>
<tr>
<td align="top" bgcolor="#ffffff"><span style="font-family: verdana,arial,helvetica; font-size: xx-small;">Ink:</span></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td bgcolor="#cccc99"><span style="font-family: verdana,arial,helvetica; font-size: xx-small;"> Pull-down Menus</span></td>
<td align="top" bgcolor="#ffffcc" height="48">
<table border="1" width="270" align="top">
<tbody>
<tr>
<td align="top" bgcolor="#ffffff"><span style="font-family: verdana,arial,helvetica; font-size: xx-small;">Black &#8211; $10.00<br />
Red &#8211; $12.00;+2<br />
Blue &#8211; $20.00;*2</span></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p>Would generate: Ink:<select name="example1"><option>Black &#8211; $10.00</option></select><br />
<select name="example1"><option>Red &#8211; $12.00</option></select><br />
<select name="example1"><option>Blue &#8211; $20.00</option></select></p>
<p>Another special rule (;n) allows you make options unselectable, but visible:</p>
<table>
<tbody>
<tr>
<td bgcolor="#cccc99"><span style="font-family: verdana,arial,helvetica; font-size: xx-small;"> Order Options Description:</span></td>
<td bgcolor="#ffffcc"><span style="font-family: verdana,arial,helvetica; font-size: xx-small;"><span style="font-family: verdana,arial,helvetica; font-size: xx-small;"><br />
</span></span></p>
<table border="1" width="270" align="top">
<tbody>
<tr>
<td align="top" bgcolor="#ffffff"><span style="font-family: verdana,arial,helvetica; font-size: xx-small;">Ink:</span></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td bgcolor="#cccc99"><span style="font-family: verdana,arial,helvetica; font-size: xx-small;"> Pull-down Menus</span></td>
<td bgcolor="#ffffcc" height="48">
<table border="1" width="270" align="top">
<tbody>
<tr>
<td align="top" bgcolor="#ffffff"><span style="font-family: verdana,arial,helvetica; font-size: xx-small;">Black<br />
Red;n<br />
Blue</span></td>
</tr>
</tbody>
</table>
<p>&nbsp;</td>
</tr>
</tbody>
</table>
<p>Would generate: Ink:<select name="example1"><option>Black</option></select><br />
<select name="example1"><option disabled="disabled">Red</option></select><br />
<select name="example1"><option>Blue</option></select></p>
<p>Using the previous example, you can expect many customers to purchase black ink, even if it is not the color they want, since black is selected by default, and many shoppers do not notice every detail of their order before placing it. The &#8220;unselectable&#8221; option is most frequently used to prevent a default option, but it could also be used to flag out-of-stock items so that they cannot be purchased.</p>
<p>Preventing a Default Selection:</p>
<hr />
<table>
<tbody>
<tr>
<td bgcolor="#cccc99"><span style="font-family: verdana,arial,helvetica; font-size: xx-small;"> Order Options Description:</span></td>
<td bgcolor="#ffffcc"><span style="font-family: verdana,arial,helvetica; font-size: xx-small;"><span style="font-family: verdana,arial,helvetica; font-size: xx-small;"><br />
</span></span></p>
<table border="1" width="270" align="top">
<tbody>
<tr>
<td align="top" bgcolor="#ffffff"><span style="font-family: verdana,arial,helvetica; font-size: xx-small;">Ink:</span></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td bgcolor="#cccc99"><span style="font-family: verdana,arial,helvetica; font-size: xx-small;"> Pull-down Menus</span></td>
<td bgcolor="#ffffcc"><span style="font-family: verdana,arial,helvetica; font-size: xx-small;"><span style="font-family: verdana,arial,helvetica; font-size: xx-small;"><br />
</span></span></p>
<table border="1" width="270" align="top">
<tbody>
<tr>
<td align="top" bgcolor="#ffffff"><span style="font-family: verdana,arial,helvetica; font-size: xx-small;">Please Select a Color;n<br />
Black<br />
Red<br />
Blue</span></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p>Would Generate: Ink:<select name="example1"><option>Please Select a Color</option><option>Black</option><option>Red</option><option>Blue</option></select></p>
<p>Prevent Purchase of Out-of-Stock Items:</p>
<hr />
<table>
<tbody>
<tr>
<td bgcolor="#cccc99"><span style="font-family: verdana,arial,helvetica; font-size: xx-small;"> Order Options Description:</span></td>
<td bgcolor="#ffffcc"><span style="font-family: verdana,arial,helvetica; font-size: xx-small;"><span style="font-family: verdana,arial,helvetica; font-size: xx-small;"><br />
</span></span></p>
<table border="1" width="270" align="top">
<tbody>
<tr>
<td align="top" bgcolor="#ffffff"><span style="font-family: verdana,arial,helvetica; font-size: xx-small;">Ink:</span></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td bgcolor="#cccc99"><span style="font-family: verdana,arial,helvetica; font-size: xx-small;"> Pull-down Menus</span></td>
<td bgcolor="#ffffcc"><span style="font-family: verdana,arial,helvetica; font-size: xx-small;"><span style="font-family: verdana,arial,helvetica; font-size: xx-small;"><br />
</span></span></p>
<table border="1" width="270" align="top">
<tbody>
<tr>
<td align="top" bgcolor="#ffffff"><span style="font-family: verdana,arial,helvetica; font-size: xx-small;">Please Select a Color;n<br />
Black<br />
Red &#8211; Out of Stock;n<br />
Blue</span></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p>Would Generate: Ink:<select name="example1"><option>Please Select a Color</option><option>Black</option><option disabled="disabled">Red &#8211; Out of Stock</option><option>Blue</option></select></p>
<p>Using these methods will force the customer to make a valid selection in the Shopping Cart; however, it will not enforce a selection outside the shopping cart. If you are displaying ordering options on your More Info pages, the product may still be added to the cart with &#8220;Please Select a Color&#8221; selected&#8211;only you will not be able to checkout until you have chosen a color. Problems can arise if you prohibit customers from changing ordering options in the cart (by checking the checkbox next to &#8220;Ordering Options can not be changed&#8221; in Commerce Setup-&gt;Order System-&gt;Shopping Cart). A customer could add some ink to the cart with &#8220;Please Select a Color&#8221; selected, then find themselves unable to select a valid color without removing the product and trying again.</p>
<p>An easy solution to this problem is to create custom Javascript that will enforce the unselectable options in your More Info pages.</p>
<p>The following script may be integrated with almost any product template to enforce unavailable options in More Info pages. It will enforce unselectable ordering options in any number of dropdown boxes, and requires two simple changes to your product template:</p>
<hr />
<p>1. Go to Merchandising-&gt;Custom Templates-&gt;Page/Product, under &#8220;Product Templates&#8221; select the product template you are using and click Edit</p>
<p>2. Scroll down until you find the [-- DEFINE MORE_INFO_PAGE --] section.</p>
<p>3. Add the following Javascript to the MoreInfo page (It does not need to be placed in the head region, but must be placed before the Add-to-Cart Form):</p>
<p>&nbsp;</p>
<pre>&lt;script type="text/javascript"&gt; 
 var LexiConn = { 
   unavailableMessage: "Please make a valid selection", 
   available: true, 
   alertAvailability: function(sender, GA){ 
     this.GA = GA; 
     if(this.available==false){ 
       alert(this.unavailableMessage); 
     } else{ 
       if(this.GA==true){ 
          window.__utmLinkPost(sender); 
       } 
     } 
 }, 
 checkAvailability: function(sender){ 
    var option_regex = /.*:finopt:.*/; 
    var value_regex = /.*;n$/; 
    this.available = true; 
    for (var i=0; i&lt;sender.length; i++){ 
     if((option_regex.test(sender[i].name))&amp;&amp;(sender[i].type!="hidden")){ 
      if(value_regex.test(sender[i].options[sender[i].selectedIndex].value)){ 
        this.available = false; 
      } 
     } 
    } 
    return this.available; 
   } 
 } 
 &lt;/script&gt; 
</pre>
<p>&nbsp;</p>
<p>4. Replace the entire opening form section with the following (you should add any additional attributes that your existing form element is using, such as &#8220;name&#8221; or &#8220;id&#8221; to each of these form elements, since they may be required by other custom scripts on your pages):</p>
<p>&nbsp;</p>
<pre>[-- IF ANALYTICS_MULTI_DOMAIN --]
&lt;form action="[-- SHOPPING_CART_URL BASE --]/order.cgi" method="post" onsubmit="var valid = LexiConn.checkAvailability(this); LexiConn.alertAvailability(this, true); return(valid);"&gt;
[-- ELSE --]
&lt;form action="[-- SHOPPING_CART_URL BASE --]/order.cgi" method="post" onsubmit="var valid = LexiConn.checkAvailability(this); LexiConn.alertAvailability(false); return(valid);"&gt;
[-- END_IF --]
</pre>
<p>&nbsp;</p>
<p>5. Save the changes and Regenerate (Utilities-&gt;Publish-&gt;Regenerate).</p>
						]]>
					</description>

					
					
				</item>

					
		
	</channel>
	</rss>

