Unique order prefix for specific customer

  • Posts: 228
  • Thank you received: 4
  • Hikashop Business
1 year 3 months ago #348016

-- HikaShop version -- : 4.7.0

Hello,
I'm developing a site for a client that has an online store an also a physical 'bricks and mortar' store that sells the same products as online.

In order to streamline the stock control, the store manager is going to use the online store to order products for sale in the store. I have setup a specific user for the store so they see the products without pricing and can order with zero price.

I have now had a question asking if this store 'customer' can have a different order / invoice prefix so it can be more easily identified when they collate and manage the orders?

I cannot see anywhere 'obvious' in the backend how to set a different prefix.

Any ideas? and if not possible can this be a feature request for future releases?

Thanks

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

  • Posts: 81539
  • Thank you received: 13069
  • MODERATOR
1 year 3 months ago #348017

Hi,

You will need to create a custom field of the table "user" and of the type "text" with the columna name "user_prefix". Don't display it on the frontend.
Then, you can create a custom field of the table "order" and of the type "text" with the column name "order_prefix". Just don't display it on the frontend and the emails, etc with the settings of the custom field.
In your special user settings, in HikaShop, you can enter the prefix you want in that custom field.
Then, you can use a mass action with:
- a trigger "after an order is created"
- an action "update the values" on the column order_prefix with the mode "operation" and the value: user.user_prefix

Then, in the "invoice number format" setting of the HikaShop configuration, you can use the tag {order_prefix} so that it will use the prefix when generating the number.

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

Time to create page: 0.055 seconds
Powered by Kunena Forum