Announcement

Collapse
No announcement yet.

Solution: Making custom variables available in the .session file

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Solution: Making custom variables available in the .session file

    Related to these posts

    http://community.actinic.com/showthread.php?t=28914
    http://community.actinic.com/showthread.php?t=28470

    If you need a Product Custom Variable available in the .session files for any reason, open Cart.pm and go to line 618

    Code:
    $pXmlCartItem->SetAttributes({'Reference' => $pCartItem->{'PRODUCT_REFERENCE'},
    'Name' => $pProduct->{'NAME'},
    'SID' => $pCartItem->{'SID'}});
    This is where the xml line for the product is added to the .session file.
    Amend it to:

    Code:
    $pXmlCartItem->SetAttributes({'Reference' => $pCartItem->{'PRODUCT_REFERENCE'},
    'Name' => $pProduct->{'NAME'},
    'SID' => $pCartItem->{'SID'},
    'MyCustomVariable' => $pProduct->{'CUSTOMVARS'}->{'MyCustomVariable'}});
    and bingo! The xml tag for the product now has the Product Custom Variable included and can be read. Useful if you have any serious customisation that reads directly from the .session file.
Working...
X