Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Continue shopping alternative

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 12-25-2004, 11:13 PM
 
smitcare smitcare is offline
 

Member
  
Join Date: Nov 2004
Location: UK
Posts: 12
 

Default Continue shopping alternative

With, I assume, the desire to make the shopping experience as smooth and as easy as possible I've seen a number of solutions to the continue shopping problem; most of which involve implementing back buttons.

My view was that rather than implement continue shopping buttons I should prevent the user being taken away from the page on which he or she was at the time; I wanted to do this for both the Cart and the Wishlist. Essentially so that you can Add to Cart or Add to Wishlist without ever losing your place within the site.

The problem with this method is that the user might think that nothing had actually happened. The solution to this is in two parts:

a) make the minicart visible in a prominent position so that the user can see the Item count incrementing as they add to it
b) set up a miniwishlist counter so that the same is true when adding to the wishlist

To implement b):

1) create a file /modules/Wishlist/miniwishlist.php

Code:
<?php if ( !defined('XCART_SESSION_START') ) { header("Location: ../../"); die("Access denied"); } x_session_register("wlid_eventid"); if(!empty($login)) { $count = func_query_first_cell("SELECT COUNT(*) FROM $sql_tbl[wishlist] WHERE login = '$login' "); $smarty->assign("miniwishlist_total_items", $count); } ?>

2) Add:

Code:
if(!empty($active_modules["Wishlist"])) { include $xcart_dir."/modules/Wishlist/miniwishlist.php"; }

to auth.php below the line:

Code:
include $xcart_dir.DIR_CUSTOMER."/minicart.php";

3) Modify \skin1\customer\main\minicart.tpl to:

Code:
<TABLE border="1" cellpadding="1" cellspacing="0"> <tr> <td rowspan="2" width="23">{if $minicart_total_items > 0}[img]{$ImagesDir}/cart_full.gif[/img]{else}[img]{$ImagesDir}/cart_empty.gif[/img]{/if}</td> <td colspan="3"><A href="cart.php?mode=checkout" class="VertMenuItems">{$lng.lbl_your_mini_cart}<A href="cart.php" class="VertMenuItems"></td> </tr> <tr> <td></td> <TD class="VertMenuItems">{if $minicart_total_items > 0}{$lng.lbl_items}: {else}<CENTER>{$lng.lbl_cart_is_empty}</CENTER>{/if}</TD> <TD class="VertMenuItems" color="#0000ff">{if $minicart_total_items > 0}{$minicart_total_items}{else}{/if}</TD> </tr> {if $active_modules.Wishlist ne ""} <tr> <td></td> <td colspan="3">{$lng.lbl_your_mini_wish_list}</td> </tr> <tr> <td></td> <td></td> <TD class="VertMenuItems">{if $miniwishlist_total_items > 0}{$lng.lbl_items}: {else}<CENTER>{$lng.lbl_wish_list_is_empty}</CENTER>{/if}</TD> <TD class="VertMenuItems" color="#0000ff">{if $miniwishlist_total_items > 0}{$miniwishlist_total_items}{else}{/if}</TD> </tr> {/if} </table> <HR size="1" NOSHADE class="VertMenuHr">


and create the appropriate language labels.
Note: this does not include Cart total information.

As far as never losing your place within the site is concerned you must:

c) Switch off redirection when adding to Cart:

By unchecking Redirect customer to cart: in the General Settings section of the Admin site.

d) Modify \modules\Wishlist\wishlist.php by making the following changes:

i)

Code:
#func_header_location("cart.php?mode=wishlist"); # # Redirect # if(!empty($HTTP_REFERER)) { func_header_location($HTTP_REFERER); } else { func_header_location("home.php?cat=$cat&page=$page"); }

ii)
Code:
#func_header_location("cart.php"); # # Redirect # if(!empty($HTTP_REFERER)) { func_header_location($HTTP_REFERER); } else { func_header_location("home.php?cat=$cat&page=$page"); }

Note: You could of course perameterise this change and allow it to be switched on and off via the Admin interface.


I think that's all. I'd appreciate any comments/feedback from those of you who know the system and Smarty/php better than I!
__________________
X-Cart Gold 4.0.7 => 4.0.9
Reply With Quote
  #2  
Old 12-31-2004, 01:39 PM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

Moderators, please move to Custom Mods.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 05:33 PM.

   

 
X-Cart forums © 2001-2020