Hi All,
This question has been posted many times over the years with no-one at Actinic or outside posting a solution (as yet) to the problem of SectionID (SID) lookups.
From the information I have found on this forum and from my own observations there is a PERL function in Cart.pm called LookUpSectionID().
There are also many references to $::g_InputHash{SID} within ShoppingCart.pl.
I have found the main dispatch routine that calls related add to cart subroutines at line 777 in ShoppingCart.pl which is fine. It appears that $::g_InputHash{SID} is called twice: in ProcessAddToCartCall() and in AddItemWithDefaultParams() with our setup.
We have tried with no avail to get ShoppingCart.pl to accept a blank SID InputHash and we are now asking for a little help/advice.
This doesn't work since there is no $::g_InputHash{"PRODREF"} when adding to the cart.
This didn't seem to work when we tried to extract the product reference from the .x and .y Inputs.
Can anyone shed some light on how to use Cart::LookUpSectionID (passing it the Product Reference) if the SID isn't found in the input hash?
Perhaps someone has tried this already, or perhaps someone at Actinic can shed some light on this.
I have found the following threads that have similar questions with helpful pointers but no solutions:
http://community.actinic.com/showthr...tHash%7BSID%7D
http://community.actinic.com/showthr...tHash%7BSID%7D
Thanks in advance.
This question has been posted many times over the years with no-one at Actinic or outside posting a solution (as yet) to the problem of SectionID (SID) lookups.
From the information I have found on this forum and from my own observations there is a PERL function in Cart.pm called LookUpSectionID().
There are also many references to $::g_InputHash{SID} within ShoppingCart.pl.
I have found the main dispatch routine that calls related add to cart subroutines at line 777 in ShoppingCart.pl which is fine. It appears that $::g_InputHash{SID} is called twice: in ProcessAddToCartCall() and in AddItemWithDefaultParams() with our setup.
We have tried with no avail to get ShoppingCart.pl to accept a blank SID InputHash and we are now asking for a little help/advice.
This doesn't work since there is no $::g_InputHash{"PRODREF"} when adding to the cart.
Code:
my ($nStatus, $sSID) = CART::LookUpSectionID(ACTINIC::GetPath(), $::g_InputHash{"PRODREF"}); # look it up my ($Status, $Message, $sSectionBlobName) = ACTINIC::GetSectionBlobName($sSID); # retrieve the blob name
Code:
my ($key, $value); while (($key, $value) = each %::g_InputHash) # locate the product reference { if ($key =~ /(.+)\.([xy])$/ && # Looks like an image co-ordinate, but we must rule out $key !~ /_/) # product variants (handled below) { # # We have something that ends in .x or .y. If both are present # we assume that this came from an IMAGE button # if($sImageButtonName) # already found a .[xy] suffix? { if($sSuffix ne $2) # and the suffix is different { $ProductRef = $sImageButtonName; # use the de-suffixed name } } else # first [xy] suffix { $sImageButtonName = $1; # save the key without the suffix $sSuffix = $2; # save the suffix } } }
Perhaps someone has tried this already, or perhaps someone at Actinic can shed some light on this.
I have found the following threads that have similar questions with helpful pointers but no solutions:
http://community.actinic.com/showthr...tHash%7BSID%7D
http://community.actinic.com/showthr...tHash%7BSID%7D
Thanks in advance.
Comment