[ic] Matrix options inventory -- yet again.

Jerry jerry at digitalfm.com
Thu Dec 4 02:56:19 EST 2003

> Please CC me as this email address is not on the list.
> Version: 4.9.8
> I've searched the lists and have come to no real conclusion about the
> state of inventory controls with regards to matrix options.  Here's what
> I understand: "It doesn't work the way it should.".
> Basically, you can buy things even if there is no stock in the option
> item.  It will even bring the inventory count below 0 (-5 for example).
>   This is plain silly in my opinion.  This method confuses would be IC
> users that are trying to sell clothing, for example.  As they would have
> multiple sizes, colours, etc., and different inventory for each.
> Sooo, should I stop complaining and patch it myself, or is there
> something I can do to have it notify/email/complain/etc when a
> particular option is out of stock?
> I think the current matrix option inventory system should either be
> disabled or improved.  In it's current state, it makes no sense (to me).
>   It only adds hope that it functions the same way as the regular item
> inventory does, which of course, it does not.  And in the end it may
> give some users a bad taste for IC (and less consulting money for Mike ;))
> Let me know what you think.

I know Mike Heins did a patch for the 4.8.3 version some time back
when I was looking for an easy way. You might want to look at that
here: http://www.icdevgroup.org/archive/interchange-users/2001/msg12003.html
and that worked fine except if I remember, you could end up with a blank
drop down if no item options had inventory.

Recently if an item has matrix options, I do a quick row count to make
sure there are options available for that item. If not, don't display
and the buy button and direct them to out of stock notification system.
If so, just build our own drop down with a query, containing only those
options that inventory.

  [query sql="select options.code, options.description from options LEFT
JOIN inventory ON inventory.sku=options.code where inventory.quantity > 0
AND options.sku = '[ITEM-CODE]' ORDER BY description"
		 <SELECT NAME="mv_sku">
	  <OPTION VALUE="[sql-param code]">[sql-param description]

THAT, I'm certain can be cleaned up, but it works for me and too
busy to mess with something that works. Hopefully this is a good
starting point for you. Maybe someone has a cleaner way of
getting it done.

Good luck!


More information about the interchange-users mailing list