Regarding Wishlist

  • Posts: 20
  • Thank you received: 0
9 years 7 months ago #197661

-- HikaShop version -- : HikaShop Business 2.3.4, Joomla!® E-Commerce Extension
-- Joomla version -- : Joomla 3.3
-- PHP version -- : PHP 5.2
-- Browser(s) name and version -- : mozila&crome

Hi Sir,

Wishlist button is not showing on "Prodcut details page" due to not checked the "Display 'add to wishlist' button for free products ". if i checked this option[Display 'add to wishlist' button for free products] to "YES".then wishlist button is showing. otherwise checked the "No".then wishlist button not showing on product details page.

kindly let me know what is the issues.

Thanks,
Pravin Yadav

Attachments:

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

  • Posts: 13201
  • Thank you received: 2322
9 years 7 months ago #197667

Hi,

There is indeed an issue, please replace the content of the view "product / quantity" by this code:

<?php
global $Itemid;
$url_itemid = '';
if(!empty($this->itemid))
	$url_itemid = $this->itemid;
elseif(!empty($Itemid))
	$url_itemid = '&Itemid='.$Itemid;

if($this->config->get('show_quantity_field') == -2)
	$this->params->set('show_quantity_field', @$this->row->product_display_quantity_field);

$config =& hikashop_config();

$wishlistEnabled = $config->get('enable_wishlist', 1);
$hideForGuest = 1;
if(($config->get('hide_wishlist_guest', 1) && hikashop_loadUser() != null) || !$config->get('hide_wishlist_guest', 1))
	$hideForGuest = 0;

if(!isset($this->cart))
	$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;

$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;
	}
}

$showFree = 0;
if($this->config->get('display_add_to_wishlist_for_free_products', 1) || (!$this->config->get('display_add_to_wishlist_for_free_products', 1) && $this->row->prices[0]->price_value != '0')){
	$showFree = 1;
}


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;

	$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(!empty($this->row->has_options)) {
			if($this->params->get('add_to_cart',1))
				echo $this->cart->displayButton(JText::_('CHOOSE_OPTIONS'), 'choose_options', $this->params, hikashop_contentLink('product&task=show&product_id='.$this->row->product_id.'&name='.$this->row->alias.$url_itemid.$this->category_pathway,$this->row),'window.location = \''.str_replace("'","\'",hikashop_contentLink('product&task=show&product_id='.$this->row->product_id.'&name='.$this->row->alias.$url_itemid.$this->category_pathway,$this->row)).'\';return false;', '');
		} else {
			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(hikashop_level(1) && $this->params->get('add_to_wishlist') && $wishlistEnabled && !$hideForGuest && $showFree) {
				echo '<div id="hikashop_add_wishlist">' .
					$this->cart->displayButton(JText::_('ADD_TO_WISHLIST'), $btnType, $this->params, $url, $wishlistAjax, '', $max, $min, '', false) .
					'</div>';
			}
		}
	} elseif($this->row->product_quantity > 0) {
?>
	<div class="hikashop_product_stock">
<?php
		if($this->row->product_quantity == 1 && JText::_('X_ITEM_IN_STOCK') != 'X_ITEM_IN_STOCK')
			$text = JText::sprintf('X_ITEM_IN_STOCK', $this->row->product_quantity);
		else
			$text = JText::sprintf('X_ITEMS_IN_STOCK', $this->row->product_quantity);

		echo '<span class="hikashop_product_stock_count">'.$text.'<br/></span>';

		if($config->get('button_style', 'normal') == 'css')
			echo '<br />';

		if($max <= 0 || $max > $this->row->product_quantity)
			$max = $this->row->product_quantity;

		if(!empty($this->row->has_options)) {
			if($this->params->get('add_to_cart', 1))
				echo $this->cart->displayButton(JText::_('CHOOSE_OPTIONS'), 'choose_options', $this->params, hikashop_contentLink('product&task=show&product_id='.$this->row->product_id.'&name='.$this->row->alias.$url_itemid.$this->category_pathway,$this->row),'window.location = \''.str_replace("'","\'",hikashop_contentLink('product&task=show&product_id='.$this->row->product_id.'&name='.$this->row->alias.$url_itemid.$this->category_pathway,$this->row)).'\';return false;','');
		} else {
			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(hikashop_level(1) && $this->params->get('add_to_wishlist') && $wishlistEnabled && !$hideForGuest && $showFree){
				echo '<div id="hikashop_add_wishlist">' .
					$this->cart->displayButton(JText::_('ADD_TO_WISHLIST'), $btnType, $this->params, $url, $wishlistAjax, '', $max, $min, '', false) .
					'</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->row->main->product_waitlist) || !empty($this->row->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.$url_itemid), 'window.location=\''.str_replace("'","\'",hikashop_completeLink('product&task=waitlist&cid='.$this->row->product_id.$url_itemid)).'\';return false;');
		}

		if(hikashop_level(1) && $this->params->get('add_to_wishlist')  && $wishlistEnabled && !$hideForGuest && $showFree) {
			if(!empty($this->row->has_options)) {
				if($this->params->get('add_to_cart', 1))
					echo $this->cart->displayButton(JText::_('CHOOSE_OPTIONS'),'choose_options',$this->params,hikashop_contentLink('product&task=show&product_id='.$this->row->product_id.'&name='.$this->row->alias.$url_itemid.$this->category_pathway,$this->row),'window.location = \''.str_replace("'","\'",hikashop_contentLink('product&task=show&product_id='.$this->row->product_id.'&name='.$this->row->alias.$url_itemid.$this->category_pathway,$this->row)).'\';return false;','');
			}else{
				echo '<div id="hikashop_add_wishlist">' .
					$this->cart->displayButton(JText::_('ADD_TO_WISHLIST'), 'add', $this->params, $url, $wishlistAjax, '', @$this->row->product_max_per_order, 1, '', false) .
					'</div>';
			}
		}
	}
?>
	</div>
<?php
} elseif(hikashop_level(1) && $wishlistEnabled && $this->params->get('add_to_wishlist', 1) && $showFree && !$hideForGuest && !$this->config->get('display_add_to_cart_for_free_products')) {
	if(!empty($this->row->has_options)) {
		if($this->params->get('add_to_cart', 1))
			echo $this->cart->displayButton(JText::_('CHOOSE_OPTIONS'), 'choose_options', $this->params, hikashop_contentLink('product&task=show&product_id='.$this->row->product_id.'&name='.$this->row->alias.$url_itemid.$this->category_pathway,$this->row),'window.location = \''.str_replace("'","\'",hikashop_contentLink('product&task=show&product_id='.$this->row->product_id.'&name='.$this->row->alias.$url_itemid.$this->category_pathway,$this->row)).'\';return false;', '');
	} else {
		$wishlistAjax =	'if(hikashopCheckChangeForm(\'item\''.$formName.')){ return hikashopModifyQuantity(\'' . (int)@$this->row->product_id . '\',field,1' . $formName . ',\'wishlist\','.$module_id.'); } else { return false; }';
		echo '<div id="hikashop_add_wishlist">' .
			$this->cart->displayButton(JText::_('ADD_TO_WISHLIST'), 'add', $this->params, $url, $wishlistAjax, '', @$this->row->product_max_per_order, 1, '', false) .
			'</div>';
	}
}

www.hikashop.com/support/support/documen...ize-the-display.html

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

  • Posts: 22
  • Thank you received: 2
9 years 7 months ago #198184

I replaced the code in the view product/quantity, but the wishlist is not showing as button in the product detail field, whatever setting I tried (like free products on YES).
These are my settings:



Best regards,
Cynthia

Attachments:

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

  • Posts: 22
  • Thank you received: 2
9 years 7 months ago #198185

I put the setting 'hide wishlist for guest users' on NO, so that you can try it out more easily.
URL: www.groentjecider.nl/index.php/webshop

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

  • Posts: 22
  • Thank you received: 2
9 years 7 months ago #198187

I figured out how to show the 'add to wishlist' button. As first time hikashop user I guess I have to find my way around in the system.

1. There is a setting in System > Configuration > Features > Wishlist.
2. But there is a second place where you must enable the wishlist. This is in System > Configuration > Display > Default parameters for products > Display 'Add to wishlist' button. Set it to yes and the button appears.

Last edit: 9 years 7 months ago by Cynthia-V.
The following user(s) said Thank You: Jerome

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

  • Posts: 15
  • Thank you received: 0
9 years 5 months ago #204617

I have both of those setting enabled, as well as "show wishlist for guest users" enabled, but "Add to wishlist" still doesn't show on product details page.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
9 years 5 months ago #204657

Hi,

Which version of HikaShop are you using ?
Can you provide a link to such product page ?

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

  • Posts: 15
  • Thank you received: 0
9 years 5 months ago #204673

Hi,

I'm using version 2.4.0 Business.

Here is a product page:
chathamart.com/index.php?option=com_hika...16-spears&Itemid=432

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
9 years 5 months ago #204685

Hi,

Can you make sure that the "Display 'Add to wishlist' button" option is activated in the HikaShop configuration ?
Can you also make sure that the "Display 'add to cart' button for free products" option is activated in the HikaShop configuration ?

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

  • Posts: 15
  • Thank you received: 0
9 years 5 months ago #204894

Hi,

I have both of those setting enabled, as well as "show wishlist for guest users" enabled, but "Add to wishlist" still doesn't show on product details page.

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

  • Posts: 13201
  • Thank you received: 2322
9 years 5 months ago #204968

Hi,

We made a fix for that, so please download the latest version of HikaShop from our website, the 2.5.0 and install it over your current version. :)

If you have a view override on the view "product / quantity" please backup it and delete the override.
www.hikashop.com/support/support/documen...ize-the-display.html

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

  • Posts: 15
  • Thank you received: 0
9 years 5 months ago #205177

Hi,

I installed 2.5 but still don't see "Add to wish list" button on product details pages. Is there a new setting to configure?

Thanks!

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

  • Posts: 13201
  • Thank you received: 2322
9 years 5 months ago #205187

Hi,

Please give us a screenshot of your settings under Configuration > Features > Wishlist.
Do you have a price set on your product ?

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

Time to create page: 0.089 seconds
Powered by Kunena Forum