- Posts: 85
- Thank you received: 9
Get vendor id in order number format
- pagemaster
-
Topic Author
- Offline
Less
More
6 years 2 months ago #322464
by pagemaster
Get vendor id in order number format was created by pagemaster
-- HikaShop version -- : 4.3.0
-- Joomla version -- : 3.9.20
-- PHP version -- : 7.2.26
Hello,
is it possible to add the vendor id in the order number format?
I tried to proceed in this way:
{order_vendor_id}-{date format="dmY"}-{id size="3"}
It works everything but not the order vendor id.
Just to let you know I enabled the option to let just one vendor in the cart and in this way there is ust one vendor every time in the cart
How can I proceed?
Thank you for your support
-- Joomla version -- : 3.9.20
-- PHP version -- : 7.2.26
Hello,
is it possible to add the vendor id in the order number format?
I tried to proceed in this way:
{order_vendor_id}-{date format="dmY"}-{id size="3"}
It works everything but not the order vendor id.
Just to let you know I enabled the option to let just one vendor in the cart and in this way there is ust one vendor every time in the cart
How can I proceed?
Thank you for your support
Please Log in or Create an account to join the conversation.
6 years 2 months ago #322476
by nicolas
Replied by nicolas on topic Get vendor id in order number format
Hi,
The order_vendor_id is only used for sub orders where the vendor is always unique.
For the main orders, as they can potentially be configured with products from different vendors, that value stays at 0.
Even in "one vendor" mode, you are still able to add products from different vendors in the backend, so it doesn't change the way it works and that's why what you want doesn't work.
The only solution I see is to develop a small plugin in the group "hikashop" and implement the onBeforeOrderNumberGenerate(&$order, &$result) trigger
In $order you'll have the data of the order, and in $result you can set the order number you want to be used.
That way, you can use the vendor_id set in the products (I suppose in $order->cart->products).
The order_vendor_id is only used for sub orders where the vendor is always unique.
For the main orders, as they can potentially be configured with products from different vendors, that value stays at 0.
Even in "one vendor" mode, you are still able to add products from different vendors in the backend, so it doesn't change the way it works and that's why what you want doesn't work.
The only solution I see is to develop a small plugin in the group "hikashop" and implement the onBeforeOrderNumberGenerate(&$order, &$result) trigger
In $order you'll have the data of the order, and in $result you can set the order number you want to be used.
That way, you can use the vendor_id set in the products (I suppose in $order->cart->products).
Please Log in or Create an account to join the conversation.
- pagemaster
-
Topic Author
- Offline
Less
More
- Posts: 85
- Thank you received: 9
6 years 2 months ago #322486
by pagemaster
Replied by pagemaster on topic Get vendor id in order number format
I see the documentation about triggers but I didn`t understand where I can create a new trigger. I developed a lot of code but never a trigger.
Thank you for you precious support
Thank you for you precious support
Please Log in or Create an account to join the conversation.
6 years 2 months ago #322492
by nicolas
Replied by nicolas on topic Get vendor id in order number format
Hi,
Well, you need to create a plugin of the group "hikashop".
I would recommend to check the two first parts of our developer documentation:
www.hikashop.com/support/documentation/6...mentation.html#intro
It has a link to the Joomla documentation on how to create plugins.
And then a small example of a plugin's code with 2 triggers implemented.
With that, if you're a developer, you should be able moving forward.
Well, you need to create a plugin of the group "hikashop".
I would recommend to check the two first parts of our developer documentation:
www.hikashop.com/support/documentation/6...mentation.html#intro
It has a link to the Joomla documentation on how to create plugins.
And then a small example of a plugin's code with 2 triggers implemented.
With that, if you're a developer, you should be able moving forward.
Please Log in or Create an account to join the conversation.
Time to create page: 0.158 seconds