Hi,
Right, it makes sense !
Thanks for the explanation, I didn't imagine this kind of solution.
In the file "administrator/components/com_hikaserial/views/pack/tmpl/form.php", please update the content
<tr>
<td class="key">
<label for="data[pack_params][stock_level_notify]"><?php echo JText::_('SERIAL_STOCK_LEVEL_NOTIFY'); ?></label>
</td>
<td>
<input type="text" name="data[pack_params][stock_level_notify]" value="<?php echo @$this->pack->pack_params->stock_level_notify;?>"/>
</td>
</tr>
<!-- Begin of new lines -->
<tr>
<td class="key">
<label for="data[pack_params][unlimited_quantity]"><?php echo JText::_('SERIAL_UNLIMITED_QUANTITY'); ?></label>
</td>
<td><?php
echo JHTML::_('hikaselect.booleanlist', 'data[pack_params][unlimited_quantity]', '', @$this->pack->pack_params->unlimited_quantity);
?></td>
</tr>
<!-- End of new lines -->
</table>
In the file "administrator/components/com_hikaserial/classes/product.php, in the function "refreshQuantity" please update:
- The first line of the query:
$query = 'SELECT p.product_id, pa.pack_id, floor(count(s.serial_id) / pp.quantity) as qty, pa.pack_generator, p.product_quantity ' .
By
$query = 'SELECT p.product_id, pa.pack_id, floor(count(s.serial_id) / pp.quantity) as qty, pa.pack_generator, pa.pack_params, p.product_quantity ' .
- The block:
if(!empty($p->pack_generator)) {
$p->qty = -1;
}
// Begin of new lines
if(!empty($p->pack_params)) {
$p->pack_params = unserialize($p->pack_params);
if(!empty($p->pack_params->unlimited_quantity))
$p->qty = -1;
}
// End of new lines
$products[$p->product_id] =& $p;
And you can update some of your packs with the new option for "unlimited quantity".
Regards,
PS: these modification will be include in the next release.