- Posts: 11
- Thank you received: 0
change wishlist redirection
14 years 3 weeks ago #69069
by gamederek
change wishlist redirection was created 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.
14 years 3 weeks ago #69181
by Xavier
Replied by Xavier on topic Re: change wishlist redirection
Hi gamederek,
Edit your file: "yourSite\components\com_hikashop\controllers\product.php", and try to replace the code:
By:
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.
14 years 2 weeks ago #69945
by gamederek
Replied by gamederek on topic Re: change wishlist redirection
The code you were referring to does not exist in this file.
Please Log in or Create an account to join the conversation.
14 years 2 weeks ago #69952
by nicolas
Replied by nicolas on topic Re: change wishlist redirection
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.115 seconds