Print Page | Close Window

Changing Saved Shopping Cart "Clear Cart" URL Dest

Printed From: ProductCart E-Commerce Solutions
Category: ProductCart
Forum Name: Customizing ProductCart
Forum Description: Exchange messages with other users that are customizing ProductCart.
URL: https://forum.productcart.com/forum_posts.asp?TID=3960
Printed Date: 15-July-2025 at 11:34am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Changing Saved Shopping Cart "Clear Cart" URL Dest
Posted By: Brett
Subject: Changing Saved Shopping Cart "Clear Cart" URL Dest
Date Posted: 29-August-2010 at 9:04pm
Hey guys, I have the Shopping Cart Saver enabled so when someone comes back to my site it re-adds their previous shopping cart contents. I think this was added in v4, but it may have been 3.5

Anyways, I was having an issue where a customer would arrive back at my site on some page, and then pressing clear cart would take them back to the homepage. I felt like it should keep them on the same page when they clear the cart, because they probably arrived to that specific page for a reason. I know there's an X box at the top right of the pop-up, but I felt like the clear cart button still should not take the customer off the current page.

To fix this, I edited pc/CustLOb.asp...

After this line:
Dim tempURL


I added these two lines:

Dim bRefURL
bRefURL = Request.ServerVariables("HTTP_REFERER")


Then, I changed this line:
response.redirect tempURL& "?action=clear"


...and changed tempURL to bRefURL for:
response.redirect bRefURL & "?action=clear"


After that, I edited header.asp and added these lines to the very top of the page:


<% ' If coming from custLO.asp, clear customer session
' (addresses issue with shared SSL scenario)
if request.QueryString("action") = "clear" then
     if session("admin")<>0 then
          session("idcustomer")=""
          session("pcStrCustName")=""
          session("customerCategory")=""
          session("customerType")=""
          session("ATBCustomer")= Cint(0)
          session("ATBPercentOff")= Cint(0)
          session("customerCategoryType")=""
          session("CustomerGuest")=""
     else
          Session.Abandon
     end if
end if
%>

I'm not sure if the top of header.asp is the best place for this code, but it seems to be working fine on my site.

Hopefully this is helpful to someone :) The end result is that clearing the saved shopping cart leaves the customer on the same page they arrived at, rather than directing them to the home page.




Replies:
Posted By: ProductCart
Date Posted: 30-August-2010 at 12:04am
Brett, thanks for your contribution.

Just FYI: ProductCart v4.1 already works this way: when you "clear" the cart, you stay on the same page.

-------------
The ProductCart Team

Home of ProductCart http://www.productcart.com" rel="nofollow - shopping cart software


Posted By: ITistic
Date Posted: 31-August-2010 at 4:38pm
Great to know all around. We've got clients using both of these solutions...

-------------
Shawn Berg
Owner / Project Manager
(877) iTISTIC / (877) 484-7842
http://www.iTistic.com">



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net