change wishlist redirection

  • Posts: 11
  • Thank you received: 0
11 years 6 months ago #69069

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.

  • Posts: 13201
  • Thank you received: 2322
11 years 6 months ago #69181

Hi gamederek,

Edit your file: "yourSite\components\com_hikashop\controllers\product.php", and try to replace the 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:
				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.

  • Posts: 11
  • Thank you received: 0
11 years 6 months ago #69945

The code you were referring to does not exist in this file.

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

  • Posts: 81604
  • Thank you received: 13082
  • MODERATOR
11 years 6 months ago #69952

It's that code that you need to replace by the second piece of code that Xavier proposed:

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.071 seconds
Powered by Kunena Forum