[ic] Hint for seeing internal variable data
Christian Brink
cbrink at brinkrods.com
Tue Oct 11 21:03:10 EDT 2005
Here's what I do if I want to see an internal interchange variable.
1. Create a test page - I call mine test.html (because I am so creative).
2. in the content area all you need is:
<pre>[test]</pre>
3. create a UserTag called test - I call mine test.tag (you get the
picture).
UserTag test Order
UserTag test Routine <<EOR
sub {
use Data::Dumper;
my $cart = $Vend::Items;
return Dumper $cart;
}
EOR
4. open the test.html page in your browser.
Explaination:
Data::Dumper is an extremly usefuly perl module that stringifys perl
variables. (example from #3 might be)
[
{
'price_group' => '',
'mv_ib' => 'products',
'mv_sku' => undef,
'mv_ip' => 0,
'quantity' => '1',
'gift_cert' => '',
'code' => 'FOO',
'option_type' => ''
},
{
'price_group' => '',
'mv_ib' => 'products',
'mv_sku' => undef,
'quantity' => '1',
'mv_ip' => '1',
'gift_cert' => '',
'code' => 'BAR',
'option_type' => ''
}
]
So basically you can feed Dumper any interchange internal variable (like
$Session and $Item) and get the structure real time.
Make sure you take down the page when you are done, so people don't get
a view of info you don't want them to.
Christian
More information about the interchange-users
mailing list