[Skip to main content](#vessel-content)

#   Serial plugin - which uses product SKU, User Name and date of order

##

- **[ruslan\_zasukhin](/forum/user/34181-ruslan-zasukhin "View ruslan&#95;zasukhin's Profile")**
- [![ruslan&#95;zasukhin's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar34181.jpg)](/forum/user/34181-ruslan-zasukhin "View ruslan&#95;zasukhin's Profile") Topic Author
- [ Offline](/forum/user/34181-ruslan-zasukhin)

Less More

- Posts: 37
- Thank you received: 1
-
-

12 years 1 month ago [\#173966](#173966) by [ruslan\_zasukhin](/forum/user/34181-ruslan-zasukhin "View ruslan&#95;zasukhin's Profile")  *[Serial plugin - which uses product SKU, User Name and date of order](/forum/17-serial-how-to/872028-serial-plugin-which-uses-product-sku-user-name-and-date-of-order#173966 "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.  Okay, I was able to print order&#95;id, but have stick on products. It is empty. I have try to load it, but then I get exception about SQL syntax error.  so HOW TO?")* was created by *[ruslan\_zasukhin](/forum/user/34181-ruslan-zasukhin "View ruslan&#95;zasukhin's Profile")*

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.
Code:

public function generate(&amp;$pack, &amp;$order, $quantity, &amp;$serials) { error_log( "order_id = $order-&gt;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.
Code:

$orderClass = hikashop_get('class.order'); $orderClass-&gt;loadProducts( $order-&gt;order_id ); foreach( $order-&gt;products as $k =&gt; $product ) { error_log( "product_id = $product-&gt;product_id" ); error_log( "product_name = $product-&gt;product_name" ); }

so HOW TO?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzE3LXNlcmlhbC1ob3ctdG8vODcyMDI4LXNlcmlhbC1wbHVnaW4td2hpY2gtdXNlcy1wcm9kdWN0LXNrdS11c2VyLW5hbWUtYW5kLWRhdGUtb2Ytb3JkZXI/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

12 years 1 month ago [\#173969](#173969) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Serial plugin - which uses product SKU, User Name and date of order](/forum/17-serial-how-to/872028-serial-plugin-which-uses-product-sku-user-name-and-date-of-order#173969 "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.  Okay, I was able to print order&#95;id, but have stick on products. It is empty. I have try to load it, but then I get exception about SQL syntax error.  so HOW TO?")*

Hi,

The $order parameter is an object with some "order" data, like the cart content.
In this object, you can find all information you need.
My recommendation : make a "var_dump" of the $order (or use jdump / dbug... the lib you preferred)

And more than that, you didn't look at the "secure ebook" plugin which use data from the products (the product code).

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzE3LXNlcmlhbC1ob3ctdG8vODcyMDI4LXNlcmlhbC1wbHVnaW4td2hpY2gtdXNlcy1wcm9kdWN0LXNrdS11c2VyLW5hbWUtYW5kLWRhdGUtb2Ytb3JkZXI/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

Moderators: [Obsidev](/forum/user/7040-obsidev "View Obsidev's Profile")

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.044 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
