Skip to main content

change wishlist redirection

More
14 years 3 weeks ago #69069 by gamederek
I add things to our wishlists and the wishlist automatically redirects to a page with the wishlist. Isn't is supposed to operate more like the cart? How do I configure it so it doesn't behave this way?

Please Log in or Create an account to join the conversation.

More
14 years 3 weeks ago #69181 by Xavier
Hi gamederek,

Edit your file: "yourSite\components\com_hikashop\controllers\product.php", and try to replace the code:
Code:
switch($redirectConfig){ [...] } if(empty($url)){ global $Itemid; if(isset($from_id))$cart_id = $from_id; if(JRequest::getInt('new_'.$cart_type.'_id',0)!= 0 && JRequest::getInt('delete',0) == 0)$cart_id = JRequest::getInt('new_'.$cart_type.'_id',0); $cart = $class->get($cart_id,false,$cart_type); if(!empty($cart) && (int)$cart_id != 0){ $url = 'cart&task=showcart&cart_type=wishlist&cart_id='.$cart_id.'&Itemid='.$Itemid; }else{ $url = 'cart&task=showcarts&cart_type=wishlist&Itemid='.$Itemid; } $url = hikashop_completeLink($url,false,true); } $this->setRedirect($url);

By:
Code:
switch($redirectConfig){ case 'ask_user': $url = JRequest::getVar('return_url',''); if(!empty($url)){ $url=base64_decode(urldecode($url)); } if(JRequest::getInt('popup')){ if(strpos($url,'?')){ $url.='&'; }else{ $url.='?'; } $url.='popup=1&cart_type=wishlist&cart_id='.$cart_id; } JRequest::setVar('cart_type','wishlist'); break; case 'stay': $stay = 1; break; case 'checkout': case 'stay_if_cart': $module = JModuleHelper::getModule('hikashop_cart',false); if($module != null){ $stay = 1; } break; default: break; } if(empty($url)){ global $Itemid; if(isset($from_id))$cart_id = $from_id; if(JRequest::getInt('new_'.$cart_type.'_id',0)!= 0 && JRequest::getInt('delete',0) == 0)$cart_id = JRequest::getInt('new_'.$cart_type.'_id',0); $cart = $class->get($cart_id,false,$cart_type); if(!empty($cart) && (int)$cart_id != 0){ $url = 'cart&task=showcart&cart_type=wishlist&cart_id='.$cart_id.'&Itemid='.$Itemid; }else{ $url = 'cart&task=showcarts&cart_type=wishlist&Itemid='.$Itemid; } $url = hikashop_completeLink($url,false,true); } if($stay == 0) $this->setRedirect($url); else{ echo '<html><head><script type="text/javascript">history.back();</script></head><body></body></html>'; exit; }

Please Log in or Create an account to join the conversation.

More
14 years 2 weeks ago #69945 by gamederek
The code you were referring to does not exist in this file.

Please Log in or Create an account to join the conversation.

More
14 years 2 weeks ago #69952 by nicolas
It's that code that you need to replace by the second piece of code that Xavier proposed:
Code:
global $Itemid; if(isset($from_id))$cart_id = $from_id; if(JRequest::getInt('new_'.$cart_type.'_id',0)!= 0 && JRequest::getInt('delete',0) == 0)$cart_id = JRequest::getInt('new_'.$cart_type.'_id',0); $cart = $class->get($cart_id,false,$cart_type); if(!empty($cart) && (int)$cart_id != 0){ $url = 'cart&task=showcart&cart_type=wishlist&cart_id='.$cart_id.'&Itemid='.$Itemid; }else{ $url = 'cart&task=showcarts&cart_type=wishlist&Itemid='.$Itemid; } $url = hikashop_completeLink($url,false,true); $this->setRedirect($url);

Please Log in or Create an account to join the conversation.

Time to create page: 0.091 seconds
Powered by Kunena Forum