Editing the Referer Link

The Click Here To Continue Shopping link is used by default on most of the Cart32 pages. Cart32 will read the http_referer (yes, typo in the http standard) and use that as a link on the Cart32 page. This allows a customer to click that link after adding an item to the cart and be taken back to the page they were just shopping on. There are ways to manipulate this for various scenarios. Use the quick links to find the section you need.

 

Important Note: Internet security programs will sometimes interfere with the functionality of this feature. Many “security” programs will block or mangle the http_referer variable, which means Cart32 has no way of knowing what page the customer came from. We encourage our client to tell their customers to disable this whenever possible, but often times this is not possible. See Going ‘Back’ A Certain Number Of Pages for the only other workaround for this.

 

Quick Links:
Specifying A Static URL
Going ‘Back’ A Certain Number Of Pages
Special Referrer Based On Item
Changing The Link Text To Something Custom

 


 

 

Specifying A Static URL
Many people prefer to simply have the continue shopping link return to a static page. For example, if your site was http://Cart32.com, you could code the link to always return a customer to http://Cart32.com/index.asp (home page) if you wanted. This involves modifying all of the template files that have a referer tag in it. Here is how you can do that:

Modifying Referer URL In Template Files

 

  1. Log into your Cart32 Administration. Navigate to the Appearance –> Template Files tab.
  2. Select Itemlist.html from the dropdown list and click Load Template File.
  3. Scroll down in the text window until you see: <a href=”<!Referer>”><!RefererText></a>. Change the href attribute from <!Referer> to your URL (in our example, http://cart32.com/index.asp).
  4. Click save
  5. Repeat the last two steps for each template file with the referer tag in it. Note that not all template files will have the referer tag in it.

 


Going ‘Back’ A Certain Number Of Pages
Often times it is necessary to go back a certain number of pages instead of just to the last “referer”. Clients with pre-cart scripts or other similar situations often need to send the client back numerous pages. Javascript allows for this via the history.go(int) method. This method accepts a number indicating how many pages back the client’s browser window should go.

 

The way to do this is very similar to how we specified a static URL above. Follow those same steps to reach your template files. For each template file we will remove <a href=”<!Referer>”><!RefererText></a> altogether. We will then replace it one of two ways. We can use a Form or a link. Here are examples of both options:

 

form name=”goBackForm” input type=”button” value=”Return To Shopping” onclick=”history.go(-1)” /form

<a href=”#” onclick=”history.go(-1)”>Return To Shopping</a>

(Note: Any item on a page can have an onclick event. You could use the onclick attribute with an image or whatever you wanted.)

 


 

 

Special Referrer Based On Item
Clients may find themselves needing to be able to specify a special return page for certain items. For example, if you have a special item that you want to cross sell with, you might want to redirect the customer to a page with complimentary items to purchase. This is done through the form code for the item. Here is an example of how you could specify the Continue Shopping link location with form code:

 

<form method=”post” action=”http://cart32hostingred.com/cgi-bin/cart32.exe/kyle-additem”>
<input type=”hidden” name=”item” value=”shirt” />
<input type=”hidden” name=”price” value=”5.00″ />
<input type=”text” name=”qty” value=”1″ />
<input type=”hidden” name=”referer” value=”http://cart32.com/index.asp” />
<input type=”submit” value=”now” />
</form>

 


 

 

Changing The Link Text To Something Custom
The default text for the continue shopping link is Click Here To Continue Shopping. This text can be changed using the following steps:

 

  1. Log into your Cart32 Administration. Navigate to the Appearance –> All Pages tab.
  2. Change the text in the Referer Text field to whatever you like.
  3. Click save.

Log in