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

How to disable Wish List redirect

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 09-08-2008, 02:48 PM
 
wayfarer wayfarer is offline
 

Advanced Member
  
Join Date: Apr 2003
Posts: 56
 

Default How to disable Wish List redirect

Hi all,

I am trying to work out how to make Add to Wish List work more like Buy Now in the sense that the item is added, without the customer being redirected to the Wish List each time...

I'm thinking it must be reasonably simple and have tried to compare how the Buy Now is coded with how the Wish List is, but haven't had any realisations. I've searched this forum and haven't come across anything on the subject...

Can anyone point out where to make a code adjustment?
__________________
X Cart Pro
v. 4.1.9
Download Expander (from Altered Cart)
X-Magnifier
Dynamic Preview (from BCS Engineering)
Customer Rewards Points (BCSE), used as credit purchasing system
Reply With Quote
  #2  
Old 09-09-2008, 06:30 AM
  Yurij's Avatar 
Yurij Yurij is offline
Banned
 

X-Adept
  
Join Date: Jan 2008
Posts: 486
 

Default Re: How to disable Wish List redirect

I am not sure, but try to do so:

open file "modules/Wishlist/wishlist.php" and find next lines:

PHP Code:
if (!empty($active_modules['SnS_connector']))
        
func_generate_sns_action("AddToWishList");

    
func_header_location("cart.php?mode=wishlist"); 

and replace this code by this:

PHP Code:
if (!empty($active_modules['SnS_connector']))
        
func_generate_sns_action("AddToWishList");

    
    
func_header_location($_SERVER["HTTP_REFERER"]);
//    func_header_location("cart.php?mode=wishlist"); 

After clicking on button "Add to wish list" the customer will stay on the this page.
Reply With Quote

The following 2 users thank Yurij for this useful post:
acidon (11-27-2016), TheWrongGrape (05-14-2010)
  #3  
Old 09-09-2008, 04:52 PM
 
wayfarer wayfarer is offline
 

Advanced Member
  
Join Date: Apr 2003
Posts: 56
 

Talking Re: How to disable Wish List redirect

Beautiful! Thankyou very much for the fast reply and simple solution - works brilliantly...
__________________
X Cart Pro
v. 4.1.9
Download Expander (from Altered Cart)
X-Magnifier
Dynamic Preview (from BCS Engineering)
Customer Rewards Points (BCSE), used as credit purchasing system
Reply With Quote
  #4  
Old 09-09-2008, 06:14 PM
 
wayfarer wayfarer is offline
 

Advanced Member
  
Join Date: Apr 2003
Posts: 56
 

Unhappy Re: How to disable Wish List redirect

Actually... no it doesn't work. It will only work if a section of button.tpl is commented out. This section here:

{if $js_to_href ne 'Y'}
{assign var="onclick" value=$href}
{assign var="href" value="javascript: void(0);"}
{/if}

HOWEVER, if I do that then this small mod (http://forum.x-cart.com/showthread.php?t=40022), which is supposed to show the number of items in the customer's wish list every time something is added, doesn't update the number of items - until the page is refreshed by clicking on another page or actually going to the wish list page...

I have included the full text of my button.tpl - what is the significance of that piece of code and how can make a change that will allow the disabling of the wish list to work, as well as have the number of items updating correctly?




{* $Id: button.tpl,v 1.25.2.2 2006/06/16 10:47:41 max Exp $ *}
{if $config.Adaptives.platform eq 'MacPPC' && $config.Adaptives.browser eq 'NN'}
{assign var="js_to_href" value="Y"}
{/if}
{if $type eq 'input'}
{assign var="img_type" value='input class="InputNoBorder" type="image"'}
{else}
{assign var="img_type" value='img'}
{/if}
{assign var="js_link" value=$href|regex_replace:"/^\s*javascript\s*:/Si":""}
{if $js_link eq $href}
{assign var="js_link" value="javascript: self.location='"|cat:$href|amp|cat:"';"}
{else}
{assign var="js_link" value=$href}
{if $js_to_href ne 'Y'}
{assign var="onclick" value=$href}
{assign var="href" value="javascript: void(0);"}
{/if}
{/if}

{if $style eq 'button' && ($config.Adaptives.platform ne 'MacPPC' || $config.Adaptives.browser ne 'NN')}
<table cellspacing="0" cellpadding="0" onclick="{$js_link}" class="ButtonTable"{if $title ne ''} title="{$title|escape}"{/if}>
{strip}
<tr>
<td>
<{$img_type} src="{$ImagesDir}/but1.gif" class="ButtonSide" alt="{$title|escape}" />
</td>
<td class="Button"{$reading_direction_tag}>
<font class="Button">{$button_title}</font>
</td>
<td>
<img src="{$ImagesDir}/but2.gif" class="ButtonSide" alt="{$title|escape}" />
</td>
</tr>
{/strip}
</table>
{elseif $image_menu}
{strip}
<table cellspacing="0" class="SimpleButton">
<tr>
{if $button_title ne ''}
<td>
<a class="VertMenuItemsLight" href="{$href|amp}"
{if $onclick ne ''} onclick="{$onclick}"{/if}
{if $title ne ''} title="{$title|escape}"{/if}
{if $target ne ''} target="{$target}"{/if}>
<font class="VertMenuItemsLight">{$button_title}</font>
</a>
</td>
{/if}
<td>
{if $img_type eq 'img'}
<a class="VertMenuItemsLight" href="{$href|amp}"
{if $onclick ne ''} onclick="{$onclick}"{/if}
{if $title ne ''} title="{$title|escape}"{/if}
{if $target ne ''} target="{$target}"{/if}>
{/if}
<{$img_type} {include file="buttons/go_image_menu.tpl"} />
{if $img_type eq 'img'}
</a>
{/if}
</td>
</tr>
</table>
{/strip}
{else}
{strip}
<table cellspacing="0" class="SimpleButton">
<tr>
{if $button_title ne ''}
<td>
<a class="Button" href="{$href|amp}"
{if $onclick ne ''} onclick="{$onclick}"{/if}
{if $title ne ''} title="{$title|escape}"{/if}
{if $target ne ''} target="{$target}"{/if}>
{$button_title}
</a>
</td>
{/if}
<td>
{if $img_type eq 'img'}
<a class="Button" href="{$href|amp}"
{if $onclick ne ''} onclick="{$onclick}"{/if}
{if $title ne ''} title="{$title|escape}"{/if}
{if $target ne ''} target="{$target}"{/if}>
{/if}
<{$img_type} {include file="buttons/go_image.tpl" full_url='Y'} />
{if $img_type eq 'img'}
</a>
{/if}
</td>
</tr>
</table>
{/strip}
{/if}
__________________
X Cart Pro
v. 4.1.9
Download Expander (from Altered Cart)
X-Magnifier
Dynamic Preview (from BCS Engineering)
Customer Rewards Points (BCSE), used as credit purchasing system
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 10:26 AM.

   

 
X-Cart forums © 2001-2020