[ic] Hint for seeing internal variable data
Stefan Hornburg
racke at linuxia.de
Wed Oct 12 04:04:40 EDT 2005
Christian Brink wrote:
> 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.
No big news, IC provides this feature already:
[calcn]
uneval($Items);
[/calcn]
Nevertheless I really appreciate any reports and tiny-Howtos about your
way to work with Interchange on this list.
Bye
Racke
More information about the interchange-users
mailing list