Hi Guys,
so I have look on existed plugins of HikaSerial, and as far as I see,
any of this plugin use information from User/Product/Order.
Our serial-gen algorithm uses:
- Company name if specified, else UserName
- Order Date - to produce serial with encoded date
- SKU of product/variant to define with its help OS and product.
First of all, I have try to log values of params.
public function generate(&$pack, &$order, $quantity, &$serials)
{
error_log( "order_id = $order->order_id" );
Okay, I was able to print order_id, but have stick on products.
It is empty. I have try to load it, but then I get exception about SQL syntax error.
$orderClass = hikashop_get('class.order');
$orderClass->loadProducts( $order->order_id );
foreach( $order->products as $k => $product )
{
error_log( "product_id = $product->product_id" );
error_log( "product_name = $product->product_name" );
}
so HOW TO?