Announcement

Collapse
No announcement yet.

bounce page & Single add to cart

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

    bounce page & Single add to cart

    Hi,

    I have changed the bounce page as I'm using Kermy workaround &
    changed to single add to cart which works great until you press the add to cart button with-out selecting any quanities.

    The page returns with an error

    "No products have been added to the shopping cart. Please enter the quantity of each product being ordered before pressing the 'Add to cart' button."

    If you follow the instructions and press the add to cart.
    you recive an error page

    A General Script Error Occurred

    --------------------------------------------------------------------------------
    Error: The input is NULL
    --------------------------------------------------------------------------------
    Press the Browser back button and try again or contact the site owner.

    See www.farmerschoicefreerange.co.uk

    Kermy workaround.

    my ($sSearchTag, $sReplaceTag);
    $sSearchTag = '</TITLE>';
    $sReplaceTag = $sSearchTag . "\n" .

    $sMetaTag; $sHTML =~ s/$sSearchTag/$sReplaceTag/ig;

    return ($::SUCCESS, '', $sHTML, 0);
    }

    Replace that whole section with:


    my ($sSearchTag, $sReplaceTag);
    $sSearchTag = '</TITLE>';
    my $tempStr = ".pl?SECTIONID";
    if ($ENV{'HTTP_REFERER'} =~ /$tempStr/i){ $sReplaceTag = $sSearchTag . "\n" . $sMetaTag;
    }
    else{
    $sReplaceTag = $sSearchTag . "\n" . "</head><body><script type='text/javascript'>window.location=document.referrer;</script></body></html>";
    }
    $sHTML =~ s/$sSearchTag/$sReplaceTag/ig;
    return ($::SUCCESS, '', $sHTML, 0);
    }

    Which if I remove solves the problem. But, is there any way this code can be altered so I can use it?

    Jay Cee

    #2
    Hiya

    After eventually getting around to looking at this, here's a solution for you. In the code supplied, replace

    Code:
    $sReplaceTag = $sSearchTag . "\n" . "</head><body><script type='text/javascript'>window.location=document.referrer;</script></body></html>";
    with

    Code:
    $sReplaceTag = $sSearchTag . "\n" . "</head><body><script type='text/javascript'>window.location='".$::Session->GetLastShopPage()."';</script></body></html>";
    Instead of just going back to the previous page (which was causing the error), you will be passed back to the previous catalogue page.
    www.gbradley.co.uk
    Web Development, Actinic Patches, Scripts & more

    Comment


      #3
      Thanks Kermy

      That works great for the bounce page.

      I'm still getting that other issue though as posted.

      Reguards

      Jay Cee

      Comment

      Working...
      X