[ic] Manually setting $Config->{ProductFiles}

Mike Heins mike at perusion.com
Tue Dec 16 13:05:37 EST 2003

Quoting John Allman (allmanj at houseofireland.com):
> Hi - i was hoping to do something very similar to that described in 
> http://www.icdevgroup.org/pipermail/interchange-users/2000-October/001364.html 
> but unfortunately it appears that the issue got sidetracked in subsequent 
> posts.
> I want to normally have only one table, products. But if a certain 
> condition is met i want interchange to also start reading from another 
> table.
> I have a piece of perl code which, if the condition is met, overrides 
> $Config->{ProductFiles}
> i manually set @{$Config->{ProductFiles}} = ("products","newproducts");
> i can then confirm that $Config->{ProductFiles}[0] is products and 
> $Config->{ProductFiles}[1] is newproducts. Before that 
> $Config->{ProductFiles}[1] is unset and $Config->{ProductFiles}[0] is 
> products.
> In order to get this down to as simple a situation as possible i put a 
> perl block with @{$Config->{ProductFiles}} = ("products","newproducts"); 
> at the start of flypage.html (no condition checking, it just overrides 
> it regardless) and then tried to directly access the product page of  a 
> product which only exists in newproducts. This didn't work.
> What am i missing? Is it possible to override ProductFiles like this? 
> What else should i be doing?

It is not possible in embedded Perl. If you set it then went global and
called Vend::Data::update_productbase(), it would take effect.

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

I have a cop friend who thinks he ought be able to give a new ticket;
"too dumb for conditions".

More information about the interchange-users mailing list