Hi,
HikaSerial have an pack option called "pack data".
This option has, for the moment, only one value : "SQL".
I created "pack data" in order to give the possibility to choose the source of data (internal sql, external sql, webservice, specific plugin, etc).
In your case, I think you want to use the "none pack data".
Open the file: administrator/com_hikaserial/types/pack_data.php
and add the second line
$this->values[] = JHTML::_('select.option', 'sql', JText::_('PACK_DATA_SQL'));
$this->values[] = JHTML::_('select.option', 'none', JText::_('PACK_DATA_NONE'));
(I will include it in the next version of HikaSerial).
At this moment, it won't be possible for the pack to retrieve a serial from the database.
So you can include in your plugin generator the check of the boolean field in the checkout workflow.
Using the two SQL requests from the
administrator/com_hikaserial/classes/order.php file
$query = 'SELECT serial_id FROM ' . hikaserial::table('serial') . ' WHERE serial_pack_id = '.$pack->pack_id.' AND ' ...
It should have a little modification in the generator plugins in a future release so please add a "return true;" at the end of your generate function.
With a "return false;" or "return (int)$generated_quantity" (with generated_quantity minor than requested quantity) HikaSerial would be able to send an email to the website administrator, telling him that there was a problem during the generation.
So, if your plugin update serials directly in the database, you should tell that everything right even if you doesn't return any serial to add in the database.
Best regards,