OUT OF STOCK DISPLAY

  • Posts: 77
  • Thank you received: 1
  • Hikaserial Subscription Hikashop Business
10 years 3 months ago #187868

-- url of the page with the problem -- : www.lockharttactical.com/brand/category/486-boston-leather
-- HikaShop version -- : Latest
-- Joomla version -- : latest

www.lockharttactical.com/brand/category/486-boston-leather

As seen here, the "No stock" and the "PRICE" are over lapping.

Can you help me correct this?

Thanks!

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

  • Posts: 26232
  • Thank you received: 4035
  • MODERATOR
10 years 3 months ago #187887

Hi,

You can fix it using some CSS.
www.hikashop.com/support/support/documen...ize-the-display.html

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 36
  • Thank you received: 0
10 years 3 weeks ago #199259

Hello brothers Xavier, Nicolas and Jerome,

When product if out of out, does not display for me.

Last answer from dear Xavier Was:

1. By default the string "No stock" should be displayed, so I think that you have edited the view "product / quantity" or added a translation override on the key "NO_STOCK".

**
Of Course I have changed the quantity.php in order to add the custom buttom. i only added the input type button, so i do not not was is wrong with out of stock. Here is the attached code. Thanks.
****

<?php
/**
 * @package	HikaShop for Joomla!
 * @version	2.3.0
 * @author	hikashop.com
 * @copyright	(C) 2010-2014 HIKARI SOFTWARE. All rights reserved.
 * @license	GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */
defined('_JEXEC') or die('Restricted access');
?><?php

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');
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_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{
	$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;
		}
	}
	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;
		}
		$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)){
				?>
				<input type="button" class="button btn" onClick="window.location='<?php echo $this->row->product_url; ?>'; return false;" value="comprar"/>
				<?php
				//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 && $this->config->get('display_add_to_wishlist_for_free_products','1')){
				echo '<div id="hikashop_add_wishlist">';
					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
			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(hikashop_level(1) && $this->params->get('add_to_wishlist')  && $wishlistEnabled && !$hideForGuest && $this->config->get('display_add_to_wishlist_for_free_products','1')){
				echo '<div id="hikashop_add_wishlist">';
					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
			$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(hikashop_level(1) && $this->params->get('add_to_wishlist')  && $wishlistEnabled  && !$hideForGuest && $this->config->get('display_add_to_wishlist_for_free_products','1')){
				echo '<div id="hikashop_add_wishlist">';
					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
	}elseif(hikashop_level(1) && $wishlistEnabled && $this->params->get('add_to_wishlist','1') && $this->config->get('display_add_to_wishlist_for_free_products','1') && !$hideForGuest && !$this->config->get('display_add_to_cart_for_free_products')){
		$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">';
			echo $this->cart->displayButton(JText::_('ADD_TO_WISHLIST'),'add',$this->params,$url,$wishlistAjax,'',@$this->row->product_max_per_order,1,'',false);
		echo '</div>';
	}
}

Last edit: 10 years 2 weeks ago by Xavier. Reason: Use of [code]...[/code] tags

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

  • Posts: 13201
  • Thank you received: 2322
10 years 2 weeks ago #199264

Hi,

You have to add the code:

echo JText::_('NO_STOCK').'<br/>';
right after:
	<div class="hikashop_product_no_stock">
<?php

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

Time to create page: 0.081 seconds
Powered by Kunena Forum