Wishlist access from product listing doesn´t work

  • Posts: 13201
  • Thank you received: 2322
11 years 1 month ago #94656

Hi,

You can add another class on it, like cust_add_wishlist and in this property remove the border and the background.
It's a css issue, not really related on HikaShop ;)

www.hikashop.com/fr/support/documentation/106-faq.html
www.hikashop.com/fr/support/documentatio...ize-the-display.html

The following user(s) said Thank You: Woxxx

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

  • Posts: 40
  • Thank you received: 0
11 years 1 month ago #95088

Hi Xavier,
After checking the website I have seen that the content (Beliebte) from a position have moved in product details. To try out I set quantity.php to default and the content was back on the right side again. So the problem must come from there. I was trying out add some } but it hasn`t solved the problem. Even with the code you published 5 days ago in this topic I get this problem.

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

  • Posts: 13201
  • Thank you received: 2322
11 years 1 month ago #95239

Hi,

Thanks to try this quantity content:

<?php
			$user = hikashop_loadUser();
			if(!isset($this->cart)) $this->cart = hikashop_get('helper.cart');
			if(!empty($this->row->has_options)){
				echo $this->cart->displayButton(JText::_('CHOOSE_OPTIONS'),'choose_options',$this->params,hikashop_completeLink('product&task=show&product_id='.$this->row->product_id.'&name='.$this->row->alias.$this->itemid.$this->category_pathway),'window.location = \''.str_replace("'","\'",hikashop_completeLink('product&task=show&product_id='.$this->row->product_id.'&name='.$this->row->alias.$this->itemid.$this->category_pathway)).'\';return false;','');
			}else{
				$config =& hikashop_config();
				$this->cart = hikashop_get('helper.cart');
				$url = '';
				$module_id = $this->params->get('from_module',0);
				if(empty($this->ajax)){
					$this->ajax = 'return hikashopModifyQuantity(\''.$this->row->product_id.'\',field,1,0,\'cart\','.$module_id.')';
				}
				if(@$this->row->product_sale_start || empty($this->element->main)){
					$start_date = @$this->row->product_sale_start;
				}else{
					$start_date = $this->element->main->product_sale_start;
				}
				if(@$this->row->product_sale_end || empty($this->element->main)){
					$end_date = @$this->row->product_sale_end;
				}else{
					$end_date = $this->element->main->product_sale_end;
				}

				if($end_date && $end_date<time()){
					?>
					<span class="hikashop_product_sale_end">
						<?php echo JText::_('ITEM_NOT_SOLD_ANYMORE'); ?>
					</span>
					<?php
				}elseif($start_date && $start_date>time()){
					?>
					<span class="hikashop_product_sale_start">
						<?php
						echo JText::sprintf('ITEM_SOLD_ON_DATE',hikashop_getDate($start_date,$this->params->get('date_format','%d %B %Y')));
						//TODO echo $this->cart->displayButton(JText::_('Pre-order and add to cart'),'add',$this->params,$url,$ajax);
						?>
					</span>
					<?php
				}elseif(!$this->params->get('catalogue') && ($this->config->get('display_add_to_cart_for_free_products') || !empty($this->row->prices))){
					if(@$this->row->product_min_per_order || empty($this->element->main)){
						$min = @$this->row->product_min_per_order;
					}else{
						$min = @$this->element->main->product_min_per_order;
					}
					if(@$this->row->product_max_per_order || empty($this->element->main)){
						$max = @$this->row->product_max_per_order;
					}else{
						$max = @$this->element->main->product_max_per_order;
					}
					if($min<=0){
						$min=1;
					}
					$formName = ',0';

					if (!$this->config->get('ajax_add_to_cart', 0) || ($this->config->get('show_quantity_field')>=2 && !@$this->element->product_id)) {
						if(empty($this->formName)) {
							if(@$this->row->product_id)
								$formName = ',\'hikashop_product_form_'.$this->row->product_id.'_'.$this->params->get('main_div_name').'\'';
							else
								$formName = ',\'hikashop_product_form_'.$this->params->get('main_div_name').'\'';
						} else {
							$formName = $this->formName;
						}
					}
					$wishlistAjax =	'if(hikashopCheckChangeForm(\'item\''.$formName.')){ return hikashopModifyQuantity(\'' . (int)@$this->row->product_id . '\',field,1' . $formName . ',\'wishlist\','.$module_id.'); } else { return false; }';

					if($this->row->product_quantity == -1 && !empty($this->element->main) && $this->element->main->product_quantity != -1){
						$this->row->product_quantity = $this->element->main->product_quantity;
					}
					$btnType = 'add';
					if($this->row->product_quantity==-1){
					?>
					<div class="hikashop_product_stock">
					<?php
						if($this->params->get('add_to_cart',1)){
							echo $this->cart->displayButton(JText::_('ADD_TO_CART'),'add',$this->params,$url,$this->ajax,'',$max,$min);
							$btnType = 'wish';
						}
						if($this->params->get('add_to_wishlist') && $config->get('enable_wishlist', 1) && (($config->get('hide_wishlist_guest', 1) && hikashop_loadUser() != null) || !$config->get('hide_wishlist_guest', 1))){
							echo '<div id="hikashop_add_wishlist">';
							if($user == null){
								?><input class='hikashop_cart_button' type='button' value='<?php echo JText::_('ADD_TO_WISHLIST'); ?> onclick='window.location="http://www.mydinx.com/login.html/"'/> <?php
							}else{
								echo $this->cart->displayButton(JText::_('ADD_TO_WISHLIST'),$btnType,$this->params,$url,$wishlistAjax,'',$max,$min,'',false); //Old code
							}
							echo '</div>';
						}
					}elseif($this->row->product_quantity>0){
					?>
					<div class="hikashop_product_stock">
					<?php
						echo '<span class="hikashop_product_stock_count">'.JText::sprintf('X_ITEMS_IN_STOCK',$this->row->product_quantity).'</span><br/>';
						if($config->get('button_style','normal')=='css'){
							echo '<br />';
						}
						if($max<=0 || $max>$this->row->product_quantity) $max = $this->row->product_quantity;
						if($this->params->get('add_to_cart',1)){
							echo $this->cart->displayButton(JText::_('ADD_TO_CART'),'add',$this->params,$url,$this->ajax,'',$max,$min);
							$btnType = 'wish';
						}
						if($this->params->get('add_to_wishlist')  && $config->get('enable_wishlist', 1) && (($config->get('hide_wishlist_guest', 1) && hikashop_loadUser() != null) || !$config->get('hide_wishlist_guest', 1))){
							echo '<div id="hikashop_add_wishlist">';
							if($user == null){
								?><input class='hikashop_cart_button' type='button' value='<?php echo JText::_('ADD_TO_WISHLIST'); ?> onclick='window.location="http://www.mydinx.com/login.html/"'/> <?php
							}else{
								echo $this->cart->displayButton(JText::_('ADD_TO_WISHLIST'),$btnType,$this->params,$url,$wishlistAjax,'',$max,$min,'',false); //Old code
							}
							echo '</div>';
						}
					}else{
						?>
					<div class="hikashop_product_no_stock">
					<?php
						echo JText::_('NO_STOCK').'<br/>';
						$waitlist = $this->config->get('product_waitlist',0);
						if(hikashop_level(1) && ($waitlist==2 || ($waitlist==1 && (!empty($this->element->main->product_waitlist) || !empty($this->element->product_waitlist))))){ ?>
							</div><div id="hikashop_product_waitlist_main" class="hikashop_product_waitlist_main">
							<?php
							$empty='';
							jimport('joomla.html.parameter');
							$params = new HikaParameter($empty);
							echo $this->cart->displayButton(JText::_('ADD_ME_WAITLIST'),'add_waitlist',$params,hikashop_completeLink('product&task=waitlist&cid='.$this->row->product_id),'window.location=\''.str_replace("'","\'",hikashop_completeLink('product&task=waitlist&cid='.$this->row->product_id)).'\';return false;');


						}
						if($this->params->get('add_to_wishlist')  && $config->get('enable_wishlist', 1)){
							echo '<div id="hikashop_add_wishlist">';
							if($user == null){
								?><input class='hikashop_cart_button' type='button' value='<?php echo JText::_('ADD_TO_WISHLIST'); ?> onclick='window.location="http://www.mydinx.com/login.html/"'/> <?php
							}else{
								echo $this->cart->displayButton(JText::_('ADD_TO_WISHLIST'),$btnType,$this->params,$url,$wishlistAjax,'',$max,$min,'',false); //Old code
							}
							echo '</div>';
						}
					}?>
					</div>
				<?php
				}
			}
				?>

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

  • Posts: 40
  • Thank you received: 0
11 years 1 month ago #95637

Hi Xavier,
with the last code the add to wishlist button disapeared. On the bottom you can see how I left the code. This one works fine for me.


I stiil have problems when I delete a product from the wishlist. If I do so I get redirected to
www.mydinx.com/product/updatecart/delete..._product_id-308.html

And get
Notice: Undefined variable: conf in /var/www/vhosts/mydinx.com/httpdocs/components/com_hikashop/controllers/product.php on line 389 Fatal error: Call to a member function get() on a non-object in /var/www/vhosts/mydinx.com/httpdocs/components/com_hikashop/controllers/product.php on line 389





<?php
/**
* @package HikaShop for Joomla!
* @version 2.1.0
* @author hikashop.com
* @copyright (C) 2010-2012 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
if(!isset($this->cart)) $this->cart = hikashop_get('helper.cart');
if(!empty($this->row->has_options)){
echo $this->cart->displayButton(JText::_('CHOOSE_OPTIONS'),'choose_options',$this->params,hikashop_completeLink('product&task=show&product_id='.$this->row->product_id.'&name='.$this->row->alias.$this->itemid.$this->category_pathway),'window.location = \''.str_replace("'","\'",hikashop_completeLink('product&task=show&product_id='.$this->row->product_id.'&name='.$this->row->alias.$this->itemid.$this->category_pathway)).'\';return false;','');
}else{
$config =& hikashop_config();
$this->cart = hikashop_get('helper.cart');
$url = '';
$module_id = $this->params->get('from_module',0);
if(empty($this->ajax)){
$this->ajax = 'return hikashopModifyQuantity(\''.$this->row->product_id.'\',field,1,0,\'cart\','.$module_id.')';
}
if(@$this->row->product_sale_start || empty($this->element->main)){
$start_date = @$this->row->product_sale_start;
}else{
$start_date = $this->element->main->product_sale_start;
}
if(@$this->row->product_sale_end || empty($this->element->main)){
$end_date = @$this->row->product_sale_end;
}else{
$end_date = $this->element->main->product_sale_end;
}

if($end_date && $end_date<time()){
?>
<span class="hikashop_product_sale_end">
<?php echo JText::_('ITEM_NOT_SOLD_ANYMORE'); ?>
</span>
<?php
}elseif($start_date && $start_date>time()){
?>
<span class="hikashop_product_sale_start">
<?php
echo JText::sprintf('ITEM_SOLD_ON_DATE',hikashop_getDate($start_date,$this->params->get('date_format','%d %B %Y')));
?>
</span>
<?php
}elseif(!$this->params->get('catalogue') && ($this->config->get('display_add_to_cart_for_free_products') || !empty($this->row->prices))){
if(@$this->row->product_min_per_order || empty($this->element->main)){
$min = @$this->row->product_min_per_order;
}else{
$min = @$this->element->main->product_min_per_order;
}
if(@$this->row->product_max_per_order || empty($this->element->main)){
$max = @$this->row->product_max_per_order;
}else{
$max = @$this->element->main->product_max_per_order;
}
if($min<=0){
$min=1;
}
$formName = ',0';

if (!$this->config->get('ajax_add_to_cart', 0) || ($this->config->get('show_quantity_field')>=2 && !@$this->element->product_id)) {
if(empty($this->formName)) {
if(@$this->row->product_id)
$formName = ',\'hikashop_product_form_'.$this->row->product_id.'_'.$this->params->get('main_div_name').'\'';
else
$formName = ',\'hikashop_product_form_'.$this->params->get('main_div_name').'\'';
} else {
$formName = $this->formName;
}
}
$wishlistAjax = 'if(hikashopCheckChangeForm(\'item\''.$formName.')){ return hikashopModifyQuantity(\'' . (int)@$this->row->product_id . '\',field,1' . $formName . ',\'wishlist\','.$module_id.'); } else { return false; }';

if($this->row->product_quantity == -1 && !empty($this->element->main) && $this->element->main->product_quantity != -1){
$this->row->product_quantity = $this->element->main->product_quantity;
}
$btnType = 'add';
if($this->row->product_quantity==-1){
?>
<div class="hikashop_product_stock">
<?php
if($this->params->get('add_to_cart',1)){
echo $this->cart->displayButton(JText::_('ADD_TO_CART'),'add',$this->params,$url,$this->ajax,'',$max,$min);
$btnType = 'wish';
}

if($this->params->get('add_to_wishlist') && $config->get('enable_wishlist', 1)){
echo '<div id="hikashop_add_wishlist">';
$user = hikashop_loadUser();
if($user == null){ // www.mydinx.com/login.html
echo "<input class='button_add_wishlist' type='button' value='".JText::_('ADD_TO_WISHLIST')."' onclick='window.location = \" www.mydinx.com/login.html/\"'/ >";
}
else{
echo $this->cart->displayButton(JText::_('ADD_TO_WISHLIST'),$btnType,$this->params,$url,$wishlistAjax,'',$max,$min,'',false);
}
echo '</div>';
}
}elseif($this->row->product_quantity>0){
?>
<div class="hikashop_product_stock">
<?php
echo '<span class="hikashop_product_stock_count">'.JText::sprintf('X_ITEMS_IN_STOCK',$this->row->product_quantity).'</span><br/>';
if($config->get('button_style','normal')=='css'){
echo '<br />';
}
if($max<=0 || $max>$this->row->product_quantity) $max = $this->row->product_quantity;
if($this->params->get('add_to_cart',1)){
echo $this->cart->displayButton(JText::_('ADD_TO_CART'),'add',$this->params,$url,$this->ajax,'',$max,$min);
$btnType = 'wish';
}

if($this->params->get('add_to_wishlist') && $config->get('enable_wishlist', 1)){
echo '<div id="hikashop_add_wishlist">';
$user = hikashop_loadUser();
if($user == null){ // www.mydinx.com/login.html
echo "<input class='button_add_wishlist' type='button' value='".JText::_('ADD_TO_WISHLIST')."' onclick='window.location = \" www.mydinx.com/login.html/\"'/ >";
}
else{
echo $this->cart->displayButton(JText::_('ADD_TO_WISHLIST'),$btnType,$this->params,$url,$wishlistAjax,'',$max,$min,'',false);
}
echo '</div>';
}
}else{
?>
<div class="hikashop_product_no_stock">
<?php
echo JText::_('NO_STOCK').'<br/>';
$waitlist = $this->config->get('product_waitlist',0);
if(hikashop_level(1) && ($waitlist==2 || ($waitlist==1 && (!empty($this->element->main->product_waitlist) || !empty($this->element->product_waitlist))))){ ?>
</div><div id="hikashop_product_waitlist_main" class="hikashop_product_waitlist_main">
<?php
$empty='';
jimport('joomla.html.parameter');
$params = new HikaParameter($empty);
echo $this->cart->displayButton(JText::_('ADD_ME_WAITLIST'),'add_waitlist',$params,hikashop_completeLink('product&task=waitlist&cid='.$this->row->product_id),'window.location=\''.str_replace("'","\'",hikashop_completeLink('product&task=waitlist&cid='.$this->row->product_id)).'\';return false;');
}

if($this->params->get('add_to_wishlist') && $config->get('enable_wishlist', 1)){
echo '<div id="hikashop_add_wishlist">';
$user = hikashop_loadUser();
if($user == null){ // www.mydinx.com/login.html
echo "<input class='button_add_wishlist' type='button' value='".JText::_('ADD_TO_WISHLIST')."' onclick='window.location = \" www.mydinx.com/login.html/\"'/ >";
}
else{
echo $this->cart->displayButton(JText::_('ADD_TO_WISHLIST'),'add',$this->params,$url,$wishlistAjax,'',@$this->row->product_max_per_order,1,'',false);
}
echo '</div>';
}
}?>
</div>
<?php
}
}
?>

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

  • Posts: 13201
  • Thank you received: 2322
11 years 1 month ago #95648

Do you have HikaShop 2.1.1 ?
And have you edited the controller product ?

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

  • Posts: 40
  • Thank you received: 0
11 years 1 month ago #95676

After update the problem was fixed.
Thank you Xavier

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

Time to create page: 0.081 seconds
Powered by Kunena Forum