[ic] Inventory for options

Mike Heins interchange-users@lists.akopia.com
Fri Aug 3 11:08:01 2001


Quoting MITECH Trading (michaelsen@spacey.net):
> SKU# 00007 comes in red and blue. I have made matrix options for that and
> get
> 00007red and 00007blue with each their quantities on hand.
> When one of the colors is out of stock, there is no out of stock notice
> comming up.
> The out of stock notice is controlled by 00007, and in this case the 00007
> inventory never change. Only 00007red and 00007blue change when items is
> purchased.
> 
> Are there any way to get a out of stock notice when one of the colors is out
> of stock?
> 

Sure, but it isn't in the standard flypage. Try this:

      [if-item-data options o_matrix]
	[query
	    list=1
	    sql="
		  SELECT code FROM options
 		  WHERE sku = '[item-code]'
		  AND   o_matrix = 1
	    "]
	<tr>
	    <td>[sql-data options description]</td>
	    <td>-- [if-sql-data inventory quantity > 0]
			    [page
				    href=order
				    form="
					    mv_order_item=[item-code]
					    mv_sku=[sql-code]
				    "]ORDER NOW</A>
		      [else]
			    OUT OF STOCK
		      [/else]
		      [/if-sql-data]
	    </td>
	    </tr>
	    [/query]
      [/if-item-data]

-- 
Red Hat, Inc., 3005 Nichols Rd., Hamilton, OH  45013
phone +1.513.523.7621      <mheins@redhat.com>

"Even if you're on the right track, you'll get run over if you just
sit there." -- Will Rogers