View Single Post
  #31  
Old 03-15-2005, 12:32 PM
 
smitty smitty is offline
 

Member
  
Join Date: Mar 2005
Posts: 27
 

Default

This looks like a good solution, but I got a little confused as to what the final code for the redirect section of cart.php should look like. Would it be possible for you to cut and paste the final, edited section altogether?

Thanks for your help!


Quote:
Originally Posted by elomibao
Quote:
Originally Posted by roccons
Quote:
I wish [customers] to be redirected to the Catagory page always.
Anyone has the answer to this?

For example, if they clicked in the shopping cart link (instead of adding a product) they won't like the two steps history back behaviour.

I had the same dilema. The Continue Shopping should only appear if and only if I added a product. No sense in having a Continue Shopping button if you didn't added a product in the first place.

Code:
# # Redirect # if($mode=="add" and $productid) { if($config["General"]["redirect_to_cart"]=="Y") { func_header_location("cart.php"); } else{ if(!empty($HTTP_REFERER)) { func_header_location($HTTP_REFERER); } else { func_header_location("home.php?cat=$cat&page=$page"); } } }

Changed redirect to:
Code:
func_header_location("cart.php?mode=added");

then before:
Code:
func_header_location("cart.php");

added:
Code:
if ($mode == "added") $smarty->assign("cshopping","1");

then in cart.tpl, above the checkout button:
Code:
{if $cshopping eq "1"} <TD align="right"> {include file="buttons/button.tpl" button_title="Continue Shopping" style="button" href="javascript:history.go(-2);"} </TD> {/if}

Conditions:
Redirect to cart has to be Y.
Buy Now code in templates disabled
You can only add to cart when viewing product details (or clicking on a particular product).
__________________
X-Cart version 4.0.12
PHP 5.2.4-2ubuntu5.10
MySQL server 5.0.51a-3ubuntu5.5
MySQL client 5.0.51a
Web server Apache
Operation system Linux
Perl 5.008008
Reply With Quote