[ic] tracking multiple sizes in inventory

User & mike@mule.lynchmob.org
Sat, 18 Nov 2000 13:41:25 -0500


Greetings all,

Background 


I'm running [ic] 4.6.0  and I've modified inventory to take a size field(size) and a size quantity (sizeqty), and created a new primary key called uid so I can have and entry of uid(auto incremented), sku, quantity, size and comment for each item I have in my inventory. (I
'm primarily tracking tshirts)
On the flypage I  wish to display what sizes for a given [item-code], and the quantities available if they are less than 10. 
I've tried sql queries, I've tried searches, but nothing allows me to do a constrained search of the inventory table.


Actions I've tried:




I've tried :



 <SELECT NAME="mv_order_size">

[loop prefix=sizeloop option="[modifier-name size]" search="fi=inventory/st=db/sf=sku/se=[item-order/ra=yes/ml=1000/rf=size"]

[loop prefix=qtyloop search="fi=inventory/st=db/ra=yes/ml=1000/rf=sizeqty/sf=sku/se=[item-code]/sf=size/se=[sizeloop-code]"]

<option>[sizeloop-code] -- [price code="[item-code]" size="[sizeloop-code]"] --[sizeloop-code] remaining
[/loop][/loop]
</select>



but this returns   an unconstrained list of all sizes in the inventory looped around all skus... so in a table of two skus and a variate of 3 sizes, (3x3) I get 9 iterations in my select list.





Question:


does anyone have an examples of how to do data extraction from a sql table that will allow me to search for size, sizeqty, and sku on an inventory table w/ a primary key of uid so that if I fill inventory with a list like :




1  tshirtsku1  XLARGE  34   In stock
2  tshirtsku2  XXLarge 55   In stock
3  tshirtsku3  MEDIUM  66   In stock


I can extract to get a select that looks like :

[item-code] is tshirtsku1 (on tshirtsku1.html currently)



<select name=mv_order_size">

<option>XLARGE [price code=[tshirtsku1] size=[XLARGE]] -- 34 remaining in stock

</select>



whew.

any other comments on surefire data access methods , either in perl or in [ic] tags  would appreciated. I've tried everyting else in the docs site. gah... how about that broken archive search eh ? grin


 
Mike Bloom