Can I put name of product into order number format?

  • Posts: 139
  • Thank you received: 10
6 years 3 months ago #286110

-- HikaShop version -- : 3.2.2
-- Joomla version -- : 3.8.3
-- PHP version -- : PHP 7.1.7 .
-- Browser(s) name and version -- : opera
-- Error-message(debug-mod must be tuned on) -- : N/A

Hi Hika Team

Following the instructions here:
www.hikashop.com/support/documentation/5...nfig.html#main_order

Order number format
This option enables you to set the format of order numbers. It is only available in commercial versions of HikaShop.
By default, the order number uses letters and numbers interleaved together, this is represented here with the tag {automatic_code}.
If you want to use the order number directly, you can use the tag {id}. In the tag id, you can specify the number of numbers with the size attribute. For example, {id size="5"} will result in 00123 for the order with the id 123.
You can also use the date tag in order to insert date information. For example, {date format="m/y"} will result in 02/11 for an order made in February 2011.
You can combine them to generate pretty advanced order numbers like the format RE-{id size="5"}/{date format="m/y"} used for German accounting which will result in RE-00123/02/11 for the order 123 made on February 2011.
If you need more formatting options for the date you can look at the PHP documentation: php.net/manual/fr/function.date.php
Note that the order number (and the order id) is generated when the order is created. So after you change the format here, only new orders will get their order number in the new format.



I have managed to get from:


From numbers like this:

B6D0D1
B5D9B9

to numbers like this:

RE-00641/01/18
RE-00642/01/18

with the help of this:

RE-{id size="5"}/{date format="m/y"}

I have looked at the documentation here:


php.net/manual/fr/function.date.php


But am still confused.

Is it possible to add my product name to the order:

eg

Here:

Hika Shop>Products

Each product has a product ID

or

Hika Shop>Products>Product Name:Media Foundations X.1 (MFX.1)
In the “Main options” section.

I have a product code: fcpx-media-foundations

In short is it possible to pull a name/label from the product and add it to the product code?

If so what is the syntax that I need to use?

kindly advise

Paul

Last edit: 6 years 3 months ago by paurray.

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
6 years 3 months ago #286111

Hello,

By default you can't ; since an order can have several products it's not possible to access to products via the order number generation tool.
Afterwards, if you have some development/php skills ; you can still see to create a custom plugin in your side and implement the " onBeforeOrderNumberGenerate($order, &$result) " trigger.

Regards,


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

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: paurray

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

  • Posts: 139
  • Thank you received: 10
6 years 3 months ago #286127

Hi Jerome

ok thanks for this

best

Paul

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

  • Posts: 169
  • Thank you received: 2
  • Hikashop Business
6 years 2 months ago #287045

Have you done such plugin and can share? I need it too.

Last edit: 6 years 2 months ago by arnask.

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

  • Posts: 139
  • Thank you received: 10
6 years 2 months ago #287061

Hi

Have you done such plugin and can share? I need it too.


Nope but be sure to let me know if you figure this out :lol:

best

Paul

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

  • Posts: 169
  • Thank you received: 2
  • Hikashop Business
6 years 2 months ago #287065

In this case i will need to ask some freelancer to make it. Are you willing to pay a half price of this?

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

Time to create page: 0.077 seconds
Powered by Kunena Forum