Disabling Multi Carts and/or Wishlists

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

Our Config->Display section does not have the options "Enable multi carts" or "Enable the wishlists".

...

By default, the wishlists and carts are enabled.
If you want to disable them, go in HikaShop > Configuration > Display and under the "General display options" section you can change the options: "Enable multi carts" or "Enable the wishlists".

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

  • Posts: 82721
  • Thank you received: 13338
  • MODERATOR
11 years 6 months ago #99306

It is under the tab "Features" of the configuration.

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

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

Thanks Nicolas,

I had found it, and it was set to off. However when viewing the cart we can still see the 'show the carts' and 'save' icons ... and then the Cart name input.

url : index.php?option=com_hikashop&view=cart&layout=showcart&Itemid=...

The showcart view has the test : $cart_type == 'cart' ... which passes and then the following code I think prints the 'show cart' link/icon etc

I can just comment out in the view ... but wondered if I was missing something ?

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

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

Hi,

You can edit the views "cart / showcart" and "cart / showcarts" to remove the buttons.

I will edit it on our end.

Last edit: 11 years 6 months ago by Xavier.

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

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

Thanks Xavier,

Yes, I did edit the view files.

Not related, but out of curiosity, what are you testing for here : HIKASHOP_RESPONSIVE ?

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

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

Here is how HIKASHOP_RESPONSIVE is defined:

if($configClass->get('bootstrap_design', HIKASHOP_J30)) {
	define('HIKASHOP_RESPONSIVE', true);
} else {
	define('HIKASHOP_RESPONSIVE', false);
}

Depending on the Joomla version and the option in Config > Display > General display values

The following user(s) said Thank You: Buchberger

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

  • Posts: 208
  • Thank you received: 10
9 years 6 months ago #197006

Xavier....

I was hoping this thread would point me to the code to REMOVE to get rid of all this in red.

I have already gone into Configuration to turned off ENABLE MULTI CARTS...but this in red still shows.

Can you tell me in the views / carts...which code to remove or replace to get rid of it?





Pam

Attachments:

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

  • Posts: 13201
  • Thank you received: 2322
9 years 6 months ago #197034

Hi,

You have to edit the view "cart / showcart" and replace all the code by:

<?php

// If wishlist && share == "email" > redirect to another page with a field to add many emails and a textarea with the link.
	// > Restrict to 20 emails (add a hidden option)


$cart_type = JRequest::getString('cart_type','cart');
$cart_id = JRequest::getInt('cart_id','');
$tmpl = JRequest::getString('tmpl','view');
$url_itemid = '';
global $Itemid;
if(!empty($Itemid))
	$url_itemid = '&Itemid='.$Itemid;
if($cart_type == 'wishlist') {
	$addText = JText::_('ADD_TO_CART');
} else{
	$addText = JText::_('ADD_TO_WISHLIST');
}
$app = JFactory::getApplication();
$session = JFactory::getSession();
$userCurrent = hikashop_loadUser(true);
if(isset($userCurrent))
	$userCurrent = $userCurrent->id;
else
	$userCurrent = 0;
$hasAccess = $this->cartVal->user_id == $userCurrent || $this->cartVal->session_id == $session->getId();

if(($this->cartVal->display == 'registered' && $userCurrent == 0) || ($this->cartVal->display == 'link' && JRequest::getString('link',0) == 0)){
	$this->cartVal->display = 0;
}
if(!isset($cart->prices[0])) {
	$cart->prices[0] = new stdClass();
	$cart->prices[0]->price_value = 0;
	$cart->prices[0]->price_value_with_tax = 0;
	$cart->prices[0]->price_currency_id = hikashop_getCurrency();
}

?>
<form method="POST" id="hikashop_show_cart_form" name="hikashop_show_cart_form" action="<?php echo hikashop_completeLink('cart'.$url_itemid);?>">
	<div onload="document.getElementById('task').value='savecart'" id="hikashop_cart_listing">
<?php
	if($tmpl != 'component') {

	} else {
		$js = "window.hikashop.ready( function() {setTimeout(function(){window.focus();window.print();setTimeout(function(){hikashop.closeBox();}, 1000);},1000);});";
		$doc = JFactory::getDocument();
		$doc->addScriptDeclaration("\n<!--\n".$js."\n//-->\n");
	}

	// Check the permissions
	//
	if(($this->cartVal->display && $cart_type == 'wishlist') || ($this->cartVal->display == 'main' && $cart_type == 'cart' && $hasAccess)) {
?>
<div class="iframedoc" id="iframedoc"></div>


<table id="hikashop_cart_product_listing" class="hikashop_cart_products adminlist table table-striped table-hover" cellpadding="1">
	<thead>
		<tr>
			<th class="hikashop_cart_num_title title titlenum" align="center">
				<?php echo JText::_( 'HIKA_NUM' );?>
			</th>
			<th class="hikashop_cart_image_title title" align="left">
				<?php echo JText::_( 'HIKA_IMAGE' );?>
			</th>
			<th class="hikashop_cart_name_title title" align="left">
				<?php echo JText::_('CART_PRODUCT_NAME'); ?>
			</th>
			<th class="hikashop_cart_price_title title" align="right">
				<?php echo JText::_('CART_PRODUCT_UNIT_PRICE'); ?>
			</th>
			<th class="hikashop_cart_quantity_title title" align="center">
				<?php echo JText::_('PRODUCT_QUANTITY'); ?>
			</th>
			<th class="hikashop_cart_price_title title" align="right">
				<?php echo JText::_('CART_PRODUCT_TOTAL_PRICE'); ?>
			</th>
			<th class="hikashop_cart_status_title title" align="center">
				<?php echo JText::_('HIKASHOP_CHECKOUT_STATUS'); ?>
			</th>
	<?php if($tmpl != 'component' && hikashop_level(1) && (($this->config->get('enable_wishlist') && $cart_type == 'cart') || $cart_type == 'wishlist')) { ?>
			<th class="hikashop_cart_action_title title" align="center">
				<a  style="cursor: pointer;" onClick="checkAll();"><?php echo JText::_('HIKASHOP_ADD_TO'); ?></a>
			</th>
			<th class="hikashop_cart_delete_title title" align="center">
				<?php echo JText::_('HIKA_DELETE'); ?>
			</th>
	<?php } ?>
		</tr>
	</thead>
	<tfoot>
		<tr class="hika_show_cart_total">
			<td class="hika_show_cart_total_text"><?php
				echo JText::_('HIKASHOP_TOTAL');
			?></td>
			<td></td>
			<td></td>
			<td></td>
			<td align="center" class="hika_show_cart_total_quantity"><?php
				$total_quantity = 0;
				if(!empty($this->rows)) {
					$group = $this->config->get('group_options', 0);
					foreach($this->rows as $cart) {
						if($group && $cart->cart_product_option_parent_id)
							continue;

						if(!@$cart->hide)
							$total_quantity += (int)$cart->cart_product_quantity;
					}
				}
				echo $total_quantity;
			?></td>
			<td align="right" class="hika_show_cart_total_price">
<?php
	if(empty($this->total->prices)) {
		$this->total->prices[0] = new stdClass();
		$this->total->prices[0]->price_value = 0;
		$this->total->prices[0]->price_value_with_tax = 0;
		$this->total->prices[0]->price_currency_id = hikashop_getCurrency();
	}
	if($this->config->get('price_with_tax')) {
		echo $this->currencyHelper->format($this->total->prices[0]->price_value_with_tax, $this->total->prices[0]->price_currency_id);
	}
	if($this->config->get('price_with_tax') == 2) {
		echo JText::_('PRICE_BEFORE_TAX');
	}
	if($this->config->get('price_with_tax') == 2 || !$this->config->get('price_with_tax')) {
		echo $this->currencyHelper->format($this->total->prices[0]->price_value, $this->total->prices[0]->price_currency_id);
	}
	if($this->config->get('price_with_tax') == 2) {
		echo JText::_('PRICE_AFTER_TAX');
	}
?>
			</td>
<?php
	if($tmpl != 'component') {
?>
			<td></td>
<?php
		if(hikashop_level(1) && (($this->config->get('enable_wishlist') && $cart_type == 'cart') || $cart_type == 'wishlist')) {
?>
			<td align="center"><?php
				echo $this->cart->displayButton($addText, 'wishlist', $this->params,hikashop_completeLink('cart&task=convert&cart_type=cart&cart_id='.$cart_id.$url_itemid), 'document.getElementById(\'task\').value = \'addtocart\'; document.forms[\'hikashop_show_cart_form\'].submit(); return false;');
				if($cart_type == 'wishlist' && $this->config->get('show_compare', 0) != 0 && $this->config->get('wishlist_to_compare', 0) != 0)
					echo $this->cart->displayButton(JText::_('HIKASHOP_COMPARE_LIST'), 'wishlist', $this->params, '', 'document.getElementById(\'task\').value = \'addtocart\'; document.getElementById(\'action\').value = \'compare\'; document.forms[\'hikashop_show_cart_form\'].submit(); return false;');
			?></td>
<?php
		}
?>
			<td></td>
<?php
	}
?>
		</tr>
	</tfoot>
	<tbody>
<?php
	$i = 1;
	$k = 1;
	if(!empty($this->rows)) {
		$productClass = hikashop_get('class.product');
		$group = $this->config->get('group_options',0);

		foreach($this->rows as $cart) {
			if($group && $cart->cart_product_option_parent_id)
				continue;

			if(@$cart->hide)
				continue;

			$productClass->addAlias($cart);
			$quantityLeft = $cart->product_quantity - $cart->cart_product_quantity;
			$inStock = 1;
			if(($cart->product_quantity - $cart->cart_product_quantity) >= 0 || $cart->product_quantity == -1) {
				if($cart->product_quantity == -1)
					$stockText = "<span class='hikashop_green_color'>".JText::sprintf('X_ITEMS_IN_STOCK', JText::_('HIKA_UNLIMITED'))."</span>";
				else
					$stockText = "<span class='hikashop_green_color'>".JText::sprintf('X_ITEMS_IN_STOCK', $cart->product_quantity)."</span>";
			} else {
				if($cart->product_code != @$cart->cart_product_code){
					$stockText = "<span class='hikashop_red_color'>".JText::_('HIKA_NOT_SALE_ANYMORE'). "</span>";
				}else{
					$stockText = "<span class='hikashop_red_color'>".JText::_('NOT_ENOUGH_STOCK')."</span>";
				}
				$inStock = 0;
			}
			if($k ==1)$k = 0;else $k =1;
?>
		<tr class="hikashop_show_cart row<?php echo $k; if((int)$cart->cart_product_quantity == 0) echo " hika_wishlist_green";?>">
			<td data-title="<?php echo JText::_('HIKA_NUM'); ?>" align="center"><?php echo $i; ?></td>
			<td data-title="<?php echo JText::_('HIKA_IMAGE'); ?>" align="center">
<?php
			$width = (int)$this->config->get('thumbnail_x');
			$height = (int)$this->config->get('thumbnail_y');
			if(isset($cart->images[0])) {
				$image_options = array(
					'default' => true,
					'forcesize' => $this->config->get('image_force_size', true),
					'scale' => $this->config->get('image_scale_mode','inside')
				);
				$img = $this->image->getThumbnail(@$cart->images[0]->file_path, array('width' => $width, 'height' => $height), $image_options);
				if($img->success) {
					echo '<img class="hikashop_product_cart_image" title="'.$this->escape(@$cart->images[0]->file_description).'" alt="'.$this->escape(@$cart->images[0]->file_name).'" src="'.$img->url.'"/>';
				}
			}
			//echo '<img src="' . $this->image->uploadFolder_url.'thumbnail_'.$width.'x'.$height.'/'.$cart->images[0]->file_path . '" alt="' . $cart->images[0]->file_name . '" id="hikashop_main_image" style="margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle" />';
?>
			</td>
			<td data-title="<?php echo JText::_('CART_PRODUCT_NAME'); ?>" align="left">
			<a class="hikashop_no_print" href="<?php echo hikashop_contentLink('product&task=show&cid='.$cart->product_id.'&name='.$cart->alias.$url_itemid,$cart); ?>">
<?php
			if(!isset($cart->bought) || !$cart->bought) {
				echo $cart->product_name;
			} else {
				echo JHTML::tooltip(implode('<br />',$cart->bought), JText::_('HIKA_BOUGHT_BY'), '',$cart->product_name);
			}

			if($this->params->get('show_code')) {
				echo ' ('.$cart->product_code.')';
			}
?>
				</a>
<?php
			$input='';
			if($group) {
				foreach($this->rows as $j => $optionElement) {
					if($optionElement->cart_product_option_parent_id != $cart->cart_product_id)
						continue;
?>
				<p class="hikashop_cart_option_name"><?php
					echo $optionElement->product_name;
				?></p>
<?php
					$input .='document.getElementById(\'cart_product_option_'.$optionElement->cart_product_id.'\').value=qty_field.value;';
					echo '<input type="hidden" id="cart_product_option_'.$optionElement->cart_product_id.'" name="item['.$optionElement->cart_product_id.'][cart_product_quantity]" value="'.$cart->cart_product_quantity.'"/>';
				}

				foreach($this->rows as $j => $optionElement){
					if($optionElement->cart_product_option_parent_id != $cart->cart_product_id) continue;
					if(!empty($optionElement->prices[0])){
						if(!isset($cart->prices[0])){
							$cart->prices[0]->price_value=0;
							$cart->prices[0]->price_value_with_tax=0;
							$cart->prices[0]->price_currency_id = hikashop_getCurrency();
						}
						foreach(get_object_vars($cart->prices[0]) as $key => $value){
							if(is_object($value)){
								foreach(get_object_vars($value) as $key2 => $var2){
									if(strpos($key2,'price_value')!==false) $cart->prices[0]->$key->$key2 +=@$optionElement->prices[0]->$key->$key2;
								}
							}else{
								if(strpos($key,'price_value')!==false) $cart->prices[0]->$key+=@$optionElement->prices[0]->$key;
							}
						}
					}
				}
			}
?>
			</td>
			<td data-title="<?php echo JText::_('CART_PRODUCT_UNIT_PRICE'); ?>" align="right">
<?php
				$this->setLayout('listing_price');
				$this->row=&$cart;
				$this->unit=true;
				echo $this->loadTemplate();
?>
			</td>
			<td data-title="<?php echo JText::_('PRODUCT_QUANTITY'); ?>" align="center" class="hikashop_show_cart_quantity_td">
<?php
			if((empty($cart->product_quantity_layout) && $this->config->get('product_quantity_display', '') == 'show_select') || $cart->product_quantity_layout == 'show_select'){
				$min_quantity = $cart->product_min_per_order;
				$max_quantity = $cart->product_max_per_order;
				if($min_quantity == 0)
					$min_quantity = 1;
				if($max_quantity == 0)
					$max_quantity = (int)$min_quantity * 15;
?>
				<select id="hikashop_showcart_quantity_select_<?php echo $cart->cart_product_id;?>" class="tochosen" onchange="var qty_field = document.getElementById('hikashop_product_quantity_field_<?php echo $cart->product_id;?>'); qty_field.value = this.value; if (qty_field){<?php echo $input; ?> } return false;">
<?php
				for($j = $min_quantity; $j <= $max_quantity; $j += $min_quantity){
					$selected = '';
					if($j == $cart->cart_product_quantity)
						$selected = 'selected="selected"';
					echo '<option value="'.$j.'" '.$selected.'>'.$j.'</option>';
				}
?>
				</select>
																										<!-- Should maybe use the cart_product_id instead for the products with options -->
				<input id="hikashop_product_quantity_field_<?php echo $cart->product_id;?>" type="hidden" name="data[products][<?php echo $cart->product_id;?>][quantity]" class="hikashop_show_cart_quantity"  value="<?php echo $cart->cart_product_quantity; ?>" />
<?php
			} else {
?>
				<input id="hikashop_product_quantity_field_<?php echo $cart->product_id;?>" type="text" name="data[products][<?php echo $cart->product_id;?>][quantity]" class="hikashop_show_cart_quantity"  value="<?php echo $cart->cart_product_quantity; ?>" />
<?php
			}
?>
				<div class="hikashop_cart_product_quantity_refresh">
					<a class="hikashop_no_print" href="#" onclick="var qty_field = document.getElementById('hikashop_product_quantity_field_<?php echo $cart->product_id;?>'); if (qty_field && qty_field.value != '<?php echo $cart->cart_product_quantity; ?>'){<?php echo $input; ?> qty_field.form.submit(); } return false;" title="<?php echo JText::_('HIKA_REFRESH'); ?>">
						<img src="<?php echo HIKASHOP_IMAGES . 'refresh.png';?>" border="0" alt="<?php echo JText::_('HIKA_REFRESH'); ?>" />
					</a>
				</div>
			</td>
			<td data-title="<?php echo JText::_('CART_PRODUCT_TOTAL_PRICE'); ?>" align="right">
<?php
				$this->setLayout('listing_price');
				$this->row=&$cart;
				$this->unit=false;
				echo $this->loadTemplate();
?>
			</td>
			<td data-title="<?php echo JText::_('HIKASHOP_CHECKOUT_STATUS'); ?>" align="center"><?php echo $stockText;?></td>
<?php
			if($tmpl != 'component'){
				if(hikashop_level(1) && (($this->config->get('enable_wishlist') && $cart_type == 'cart') || $cart_type == 'wishlist')) {
?>
			<td data-title="<?php echo JText::_('HIKASHOP_ADD_TO'); ?>"  align="center" class="hikashop_show_cart_add">
<?php
/*
					$cartAjax =	'if(hikashopCheckChangeForm(\'item\',\'hikashop_show_cart_form\')){ return hikashopModifyQuantity(\'' . $cart->product_id . '\',document.getElementById(\'hikashop_product_quantity_field_'.$cart->product_id.'\'),1,\'hikashop_show_cart_form\',\'wishlist\'); } else { return false; }';
					$wishlistAjax =	'if(hikashopCheckChangeForm(\'item\',\'hikashop_show_cart_form\')){ return hikashopModifyQuantity(\'' . $cart->product_id . '\',document.getElementById(\'hikashop_product_quantity_field_'.$cart->product_id.'\'),1,\'hikashop_show_cart_form\',\'cart\'); } else { return false; }';
					if($inStock ==1){
						$url = '';
						$this->params->set('show_quantity_field',2);
						if($cart_type == 'wishlist'){
							$this->ajax = $wishlistAjax;
							echo $this->cart->displayButton(JText::_('ADD_TO_CART'),'add',$this->params,$url,$this->ajax,'',$cart->product_max_per_order,$cart->product_min_per_order);
						}else{
							$this->ajax = $cartAjax;
							echo $this->cart->displayButton(JText::_('ADD_TO_WISHLIST'),'add',$this->params,$url,$this->ajax,'',$cart->product_max_per_order,$cart->product_min_per_order);
						}
					}
*/
?>
				<input type="checkbox" name="data[products][<?php echo $cart->product_id;?>][checked]" value="1"/>
			</td>
<?php
				}

				if($hasAccess) {
?>
			<td data-title="<?php echo JText::_('HIKA_DELETE'); ?>" align="center" class="hikashop_show_cart_delete">
				<a class="hikashop_no_print" href="<?php echo hikashop_completeLink('product&task=updatecart&stay=1&delete=1&quantity=0&cart_type='.$cart_type.'&cart_id='.$cart->cart_id.'&cart_product_id='.$cart->cart_product_id.'&return_url='.urlencode(base64_encode(hikashop_currentURL())).$url_itemid); ?>"  title="<?php echo JText::_('HIKA_DELETE'); ?>">
					<img src="<?php echo HIKASHOP_IMAGES . 'delete2.png';?>" border="0" alt="<?php echo JText::_('HIKA_DELETE'); ?>" />
				</a>
			</td>
<?php
				}
			}
?>
		</tr>
<?php
			$i++;
		} // end of foreach

		if($cart_type == 'wishlist')
			echo '<input type="hidden" name="add_to" value="cart"/>';
		else
			echo '<input type="hidden" name="add_to" value="wishlist"/>';
	}
?>
	</tbody>
</table>
<?php

	if($cart_type != 'cart' && $hasAccess) {
?>
<script type="text/javascript">
window.hikashop.ready(function(){
	var d = document,
		link = d.getElementById('hikashop_wishlist_link'),
		linkDisplay = d.getElementById('hikashop_wishlist_link_display'),
		linkDisplayText = d.getElementById('hikashop_wishlist_link_display_text'),
		linkShare = d.getElementById('hikashop_wishlist_share'),
		linkShareSelect = d.getElementById('hikashop_wishlist_share_select').value,
		linkShareText = d.getElementById('hikashop_wishlist_share_text');

	if(linkShareSelect == 'public') linkShareText.innerHTML = 'Anybody';
	else if(linkShareSelect == 'registered') linkShareText.innerHTML = 'Registered users';
	else if(linkShareSelect == 'email') linkShareText.innerHTML = 'E-mail';
	else linkShareText.innerHTML = 'Nobody';

	if(linkShareSelect == 'email'){
		link.style.display="table-row";
		if(linkDisplay){
			linkDisplay.value = "<?php echo $baseUrl.'cart&task=showcart&cart_id='.$cart_id.'&cart_type='.$cart_type.$url_itemid.'&link='.$token ?>";
			linkShareText.style.display="none";
		}
		if(linkDisplayText){
			linkDisplayText.innerHTML = "<?php echo $baseUrl.'cart&task=showcart&cart_id='.$cart_id.'&cart_type='.$cart_type.$url_itemid.'&link='.$token ?>";
			linkShare.style.display="none";
		}
	}else if(linkShareSelect == 'nobody'){
		link.style.display="none";
		if(linkDisplay){
			linkShareText.style.display="none";
		}else{
			linkShare.style.display="none";
		}
	}else{
		link.style.display="table-row";
		if(linkDisplay){
			linkDisplay.value = "<?php echo $baseUrl.'cart&task=showcart&cart_id='.$cart_id.'&cart_type='.$cart_type.$url_itemid; ?>";
			linkShareText.style.display="none";
		}
		if(linkDisplayText){
			linkDisplayText.innerHTML = "<?php echo $baseUrl.'cart&task=showcart&cart_id='.$cart_id.'&cart_type='.$cart_type.$url_itemid; ?>";
			linkShare.style.display="none";
		}
	}
});

function showCartLink(share){
	var d = document,
		link = d.getElementById('hikashop_wishlist_link'),
		linkShareText = d.getElementById('hikashop_wishlist_share_text'),
		linkDisplay = d.getElementById('hikashop_wishlist_link_display'),
		linkDisplayText = d.getElementById('hikashop_wishlist_link_display_text');

	link.style.display="none";

	if(share == 'public') linkShareText.innerHTML = 'Anybody';
	else if(share == 'registered') linkShareText.innerHTML = 'Registered users';
	else if(share == 'email') linkShareText.innerHTML = 'E-mail';
	else linkShareText.innerHTML = 'Nobody';

	if(share == 'public' || share == 'registered'){
		if(linkDisplay)
			linkDisplay.value = "<?php echo $baseUrl.'cart&task=showcart&cart_id='.$cart_id.'&cart_type='.$cart_type.$url_itemid; ?>";
		if(linkDisplayText)
			linkDisplayText.innerHTML = "<?php echo $baseUrl.'cart&task=showcart&cart_id='.$cart_id.'&cart_type='.$cart_type.$url_itemid; ?>";
		link.style.display="table-row";
	} else if(share == 'email'){
		<?php
			$chaine = "abcdefghijklmnpqrstuvwxy0123456789";
			srand((double)microtime()*1000000);
			for($i=0; $i<20; $i++) {
				$token .= $chaine[rand()%strlen($chaine)];
			}
			$tokenLink = '&link='.$token;
		?>
		if(linkDisplay)
			linkDisplay.value = "<?php echo $baseUrl.'cart&task=showcart&cart_id='.$cart_id.'&cart_type='.$cart_type.$url_itemid.$tokenLink ?>";
		if(linkDisplayText)
			linkDisplayText.innerHTML = "<?php echo $baseUrl.'cart&task=showcart&cart_id='.$cart_id.'&cart_type='.$cart_type.$url_itemid.$tokenLink ?>";
		link.style.display="table-row";
	} else{
		link.style.display="none";
	}
	link.focus();
}
</script>
	<input type="hidden" name="hikashop_wishlist_token" value="<?php echo $token; ?>"/>
<?php
		}

		if($cart_type == 'cart' && $total_quantity > 0 && hikashop_level(1) && $this->config->get('enable_wishlist') && $tmpl != 'component') {
			//echo '<a class="hikashop_cart_button" href="'.$baseUrl.'/index.php?option=com_hikashop&ctrl=cart&task=convert&cart_type=cart&Itemid=64">Convert cart in wishlist</a>';
			$this->params->set('cart_type','wishlist');
			echo $this->cart->displayButton(JText::_('CART_TO_WISHLIST'), 'wishlist', $this->params, hikashop_completeLink('cart&task=convert&cart_type=cart&cart_id='.$cart_id.$url_itemid), 'window.location.href = \''.hikashop_completeLink('cart&task=convert&cart_type=cart&cart_id='.$cart_id.$url_itemid,false,false,true).'\';return false;');
		}
		$itemid_for_checkout = (int)$this->config->get('checkout_itemid','0');
		if(empty($itemid_for_checkout)){
			$menuClass = hikashop_get('class.menus');
			$itemid_for_checkout = $menuClass->getCheckoutMenuIdForURL();
		}
		if(!empty($itemid_for_checkout)){
			$url_checkout = hikashop_completeLink('checkout&Itemid='.$itemid_for_checkout,false,true);
		}else{
			$url_checkout = hikashop_completeLink('checkout'.$url_itemid,false,true);
		}
		if($cart_type == 'cart' && $this->params->get('show_cart_proceed',1)) echo $this->cart->displayButton(JText::_('PROCEED_TO_CHECKOUT'),'checkout',$this->params,$url_checkout,'window.location=\''.$url_checkout.'\';return false;');
	} else {
		echo "<div class='hikashop_not_authorized'>".JText::_('HIKASHOP_NOT_AUTHORIZED')."</div>";
	}
?>
	</div>
	<div class="clear_both"></div>
	<input type="hidden" id="task" name="task" value="savecart"/>
	<input type="hidden" name="cid" value=""/>
	<input type="hidden" name="cart_id" value="<?php echo $cart_id; ?>"/>
	<input type="hidden" name="from_id" value="<?php echo $cart_id; ?>"/>
	<input type="hidden" name="cart_type" value="<?php echo $cart_type; ?>"/>
	<input type="hidden" name="token" value="<?php echo $token; ?>"/>
	<input type="hidden" id="action" name="action" value=""/>
</form>

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

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

  • Posts: 208
  • Thank you received: 10
9 years 6 months ago #197127

Yep, that did it.

I love you, man!

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

  • Posts: 2143
  • Thank you received: 747
9 years 4 months ago #205615

Xavier wrote: I will edit it on our end.


Hi HikaShop Team,

I notice that, despite this "issue" repeatedly coming up and repeated agreement and comments that - of course - it doesn't make sense and shall be changed, in v2.5.0 it's still there.

Friendly reminder: In the next version please add a check in showcart for "Enable multi carts", and display the block only if set to "yes". With only a single cart this block doesn't contribute anything other than potential confusion for customers, and causing an override to avoid this.

Thanks!


Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )

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

  • Posts: 13201
  • Thank you received: 2322
9 years 4 months ago #205677

Hi,

Thanks for this report, we just made the modification for the next release.

The following user(s) said Thank You: lousyfool

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

  • Posts: 2143
  • Thank you received: 747
9 years 4 months ago #205686

Xavier wrote: Hi,

Thanks for this report, we just made the modification for the next release.


Thanks a huge lot! :)


Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )

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

  • Posts: 2143
  • Thank you received: 747
9 years 3 months ago #207803

Hi Xavier,

I just noticed one more little oddity in this context. Perhaps you've also come across and modified this already - otherwise please do.

Settings:
Enable multi carts = no
Enable the wishlists = no

Menu item:
Type = Cart display
Cart type = Cart

Conditions:
HikaShop 2.5.0 [1507061112]
User = logged in
Cart = empty

If this user clicks on this menu item, he's ending up with "Cart listing" = layout "showcarts" instead of "Cart display" = layout "showcart".
The URL is then non-SEF even if a (hidden) menu item for "Cart listing" exists: .../index.php?option=com_hikashop&ctrl=cart&task=showcarts&cart_type=cart&Itemid=xyz

It only happens to a logged-in user with an empty cart, and seemingly only if he's never had anything in his cart, meaning that if he had deleted all cart content and visited the menu item then, it's not an issue.

Anyway, thanks in advance for fixing this, too.


Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )

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

  • Posts: 13201
  • Thank you received: 2322
9 years 3 months ago #207817

Hi,

Thanks for the report, we just corrected the issue on our end, so it will be present in the next release.
To add this modification, you have to edit the file "components/com_hikashop/views/cart/view.html.php" function "showcart()" and replace:

		if($cartVal == null){
			global $Itemid;
			$url = hikashop_contentLink('cart&task=showcarts&cart_type='.$cart_type.'&Itemid='.$Itemid);
			$app->redirect($url);
		}
By:
		if($cartVal == null){
			if($config->get('enable_multicart',0)){
				global $Itemid;
				$url = hikashop_contentLink('cart&task=showcarts&cart_type='.$cart_type.'&Itemid='.$Itemid);
				$app->redirect($url);
			}else{
				$cartClass = hikashop_get('class.cart');
				$cartVal = $cartClass->initCart();
				$cartVal->cart_share = 'no';
			}
		}

The following user(s) said Thank You: lousyfool

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

  • Posts: 2143
  • Thank you received: 747
9 years 3 months ago #207882

Hi Xavier,

Just FYI, the original code in my cart/view.html.php is

if($cartVal == null){
			global $Itemid;
			$url = HIKASHOP_LIVE.'index.php?option=com_hikashop&ctrl=cart&task=showcarts&cart_type='.$cart_type.'&Itemid='.$Itemid;
			$app->redirect($url);
		}

Nevertheless, I commented it out, inserted your snippet, and life is good. B)

Thanks a lot!


Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )

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

Time to create page: 0.112 seconds
Powered by Kunena Forum