Announcement

Collapse
No announcement yet.

Automatic Redirection after View Cart

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

    Automatic Redirection after View Cart

    Hi,

    I want to change where it redirects you too after you have clicked "add to cart".It then redirects you to the View cart contents which is fine, but THEN I want it to go back to the product you where viewing and not the top of the page you where on.

    Any help would be appreciated.

    Thanks

    Sue
    ---

    www.rainbowapothecary.co.uk

    #2
    Hi Sue,

    Below is the work-around to allow your customers to be redirected to the exact product they added to cart. This solution would work only if 'Quantity on product page' is selected which is the case on your site.
    This solution involves editing ShoppingCart.pl and would suggest you take a copy of the script as backup so that you could replace it, if something goes wrong.
    Have tested the work-around and it does work.

    Edit ShoppingCart.pl

    Search for 'sub AddSingleItem'
    Then search for...
    return (BounceAfterAddToCart());
    replace with...
    Code:
    return (BounceAfterAddToCart($sProdRef));
    Search for 'sub BounceAfterAddToCart' you should see...

    sub BounceAfterAddToCart
    {
    my ($Status, $Message, %OrderDetails, $sCartID, @Response);

    Replace with...

    Code:
    sub BounceAfterAddToCart
       {
       my ($sProdref) = @_;
       my $sAnchor = ($sProdref eq "") ? "" : "#a". $sProdref;      #gtc
       my ($Status, $Message, %OrderDetails, $sCartID, @Response);
    Search for 'standard confirmation', you should see...
    else # standard confirmation
    {
    @Response = ReturnToLastPage($nBounceDelay, ACTINIC::GetPhrase(-1, 1962) . $sCartHTML . ACTINIC::GetPhrase(-1, 1970) . ACTINIC::GetPhrase(-1, 2051),
    $sPageTitle);

    replace with...

    Code:
    else            # standard confirmation
      {
      my $sRefPage = $::Session->GetLastShopPage() . $sAnchor;
      @Response = ACTINIC::BounceToPageEnhanced($nBounceDelay, ACTINIC::GetPhrase(-1, 1962) . $sCartHTML . ACTINIC::GetPhrase(-1, 1970) . ACTINIC::GetPhrase(-1, 2051), $sPageTitle, $::g_sWebSiteUrl, $::g_sContentUrl, $::g_pSetupBlob, $sRefPage, \%::g_InputHash);
    
    #  @Response = ReturnToLastPage($nBounceDelay, ACTINIC::GetPhrase(-1, 1962) . $sCartHTML . ACTINIC::GetPhrase(-1, 1970) . ACTINIC::GetPhrase(-1, 2051),
    #  $sPageTitle);
    Save and Exit
    Refresh the website.

    Regards,
    Robert.

    Comment


      #3
      Thank you Robert,
      That sounds great, will get on to it now and let you know.

      Sue

      Comment

      Working...
      X