[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ic] Hint for seeing internal variable data


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

_______________________________________________
interchange-users mailing list
suppressed
http://www.icdevgroup.org/mailman/listinfo/interchange-users


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.