if($this->row->product_quantity==-1){
?>
<div class="hikashop_product_stock">
<?php
echo $this->cart->displayButton(JText::_('ADD_TO_CART'),'add',$this->params,$url,$this->ajax,'',$this->row->product_max_per_order,$this->row->product_min_per_order);
}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/>';
$config =& hikashop_config();
if($config->get('button_style','normal')=='css'){
echo '<br />';
}
if($this->row->product_max_per_order<=0 || $this->row->product_max_per_order>$this->row->product_quantity) $this->row->product_max_per_order = $this->row->product_quantity;
echo $this->cart->displayButton(JText::_('ADD_TO_CART'),'add',$this->params,$url,$this->ajax,'',$this->row->product_max_per_order,$this->row->product_min_per_order);
}else{
?>
<div class="hikashop_product_no_stock">
<?php
echo JText::_('NO_STOCK');
$waitlist = $this->config->get('product_waitlist',0);
if(hikashop_level(1) && ($waitlist==2 || ($waitlist==1 && !empty($this->element->product_waitlist)))){ ?>
</div><div id="hikashop_product_waitlist_main" class="hikashop_product_waitlist_main">
<?php
$empty='';
$params = new JParameter($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;');
}
}?>
</div>