ProductCart E-Commerce Solutions Homepage
Forum Home Forum Home > ProductCart > Customizing ProductCart
  New Posts New Posts RSS Feed - Changing Saved Shopping Cart "Clear Cart" URL Dest
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Changing Saved Shopping Cart "Clear Cart" URL Dest

 Post Reply Post Reply
Author
Message
Brett View Drop Down
Groupie
Groupie
Avatar

Joined: 22-April-2008
Location: Phoenix, AZ
Status: Offline
Points: 89
Post Options Post Options   Thanks (0) Thanks(0)   Quote Brett Quote  Post ReplyReply Direct Link To This Post Topic: Changing Saved Shopping Cart "Clear Cart" URL Dest
    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.

Back to Top
ProductCart View Drop Down
Admin Group
Admin Group

ProductCart Team

Joined: 01-October-2003
Status: Offline
Points: 135
Post Options Post Options   Thanks (0) Thanks(0)   Quote ProductCart Quote  Post ReplyReply Direct Link To This Post 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 shopping cart software
Back to Top
ITistic View Drop Down
Certified ProductCart Developers
Certified ProductCart Developers


Joined: 26-January-2009
Location: FL
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote ITistic Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.098 seconds.