[ic] RE: mv_ib and overriding default catalog

Mike Heins interchange-users@icdevgroup.org
Thu Oct 10 14:51:00 2002


Quoting Jerry Brady (jbrady@bluecircletech.com):
> Folks,
> 
> I have two products tables in a single catalog and system requirements
> are such that the catalog a person is able to search and order from is
> determined by a flag in their userdb record.
> 
> Searches work because I use the fi=<product table name> to limit the
> search based on the type of user that is logged in.  No problem here.
> 
> The checkout and backend systems work because I pull product attributes
> from the correct  by using things like [item-data <table> price] instead
> of [item-price], and so, on.
> 
> There is one exception and that is the basket page which loads the
> 'cart' component by default.  I've modified the cart component to permit
> adding a sku and quantity to an existing or empty cart.
> 
> If a user enters a sku from their permitted catalog everything is fine.
> If a user enters a sku that doesn't exist in either catalog everything
> is fine.
> If a user enters a sku from the catalog they are not permitted to use
> there is a problem.
> 
> When the page refreshes the item is added to the cart using data from
> the other products table, but of course since I only pull data from the
> catalog the user can see, the result is a basket entry with blank values
> except for the quantity field.
> 
> Using [dump] and combing the docs and archives, I believe that this is
> caused by the value of mv_ib="products" (the other products table is
> called spot_products) which is set internally by Interchange.
> 
> Basically, if the cart gets refreshed with mv_order_item set to a valid
> sku from the unauthorized catalog, it gets added to the cart anyway
> because mv_ib="products".
> 
> How can I override this behavior to tell Interchange to only add items
> from a specific product table?

You would set "ProductFiles" in the user profile to only be for
the allowed catalog.

If you have a profile running (ala what is in etc/after.cfg) then
just add:

	ProductFiles => [ 'products' ],

or 

	ProductFiles => [ 'spot_products' ],

depending on which they are.

-- 
Mike Heins
Perusion -- Expert Interchange Consulting    http://www.perusion.com/
phone +1.513.523.7621      <mike@perusion.com>

Software axiom: Lack of speed kills.