Modification: the minimum order quantity

  • Posts: 50
  • Thank you received: 4
13 years 9 months ago #8721

Hi Nicolas.
Please include the following releases small correction.
Moreover, that the functional store /displayButton()/ supports it.
The minimum order quantity. It is necessary for some specific shops, for example - polygraphy.
administrator\components\com_hikashop\views\product\tmpl\
defined('_JEXEC') or die('Restricted access');
?>
<tr>
<td class="key">
<label for="product_quantity">
<?php echo JText::_( 'PRODUCT_QUANTITY' ); ?>
</label>
</td>
<td>
<input type="text" name="data[product][product_quantity]" <?php echo is_numeric(@$this->element->product_max_per_order)? '' : 'onfocus="this.value=\'\';"'; ?> value="<?php echo @$this->element->product_quantity; ?>" />
</td>
</tr>

<tr>
<td class="key">
<label for="data[product][product_min_per_order]">
<?php echo JText::_( 'PRODUCT_MIN_QUANTITY_PER_ORDER' ); ?>
</label>
</td>
<td>
<input type="text" name="data[product][product_min_per_order]" <?php echo is_numeric(@$this->element->product_min_per_order)? '' : 'onfocus="this.value=\'\';"'; ?> value="<?php echo @$this->element->product_min_per_order; ?>" />
</td>
</tr>


\components\com_hikashop\views\product\tmpl\
defined('_JEXEC') or die('Restricted access');
?>
<?php
$min_q = $this->row->product_min_per_order;
$min_q = ($min_q <= 0) ? (1) : ($min_q);


line 37
<span 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,$min_q);
}elseif($this->row->product_quantity>0){
?>
line 50
echo $this->cart->displayButton(JText::_('ADD_TO_CART'),'add',$this->params,$url,$this->ajax,'',$this->row->product_max_per_order,$min_q);

To change the database
ALTER TABLE `#__hikashop_product` ADD `product_min_per_order` INT UNSIGNED DEFAULT 0

And add to lang file
PRODUCT_MIN_QUANTITY_PER_ORDER='Minimum Order quantity of product'

Thanks :)

Last edit: 13 years 9 months ago by korkunov.
The following user(s) said Thank You: pepecortez

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

  • Posts: 83007
  • Thank you received: 13398
  • MODERATOR
13 years 9 months ago #8745

We'll add that to next release then.

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

Time to create page: 0.055 seconds
Powered by Kunena Forum