Advanced order management

  • Posts: 22
  • Thank you received: 1
8 years 8 months ago #250129

Hello,
We're using HikaShop Business to handle our food delivery service. Until now to handle time of delivery we used product features/variants, defining several features, one for each time of delivery. This system has been useful until we could deliver as many products as customers did order.
Actually we need to restrict or manage the maximum number of deliveries we can do during a time slice (let's say that we use to have 4 different times to deliver products). So we need a way to set up the maximum number of order we can deliver in such a time slice. If we use features/variants we can allow people choose the time for the delivery but we cannot set the number of possible deliveries in such time slice. Furthermore we cannot use the product quantity to set availability because we can sell contemporary 6 different products and we can't know before how many units of each products will be ordered. If we use availability in variants we have to decide before the quantity for each variant and this could be a strong limit for us because we can't decide the sold quantity of each product and we can't loose potential customers with a bad setting of availability.
So we thought that we should handle restrictions in the order management, but, actually we can't do it or we don't know how to do it.
Our needs are:
- we have 30 products in our catalog every week.
- we have 6 different products sold every day. Think to a menu in a restaurant.
- we need to manage deliveries in 4 time slices.
- customers can choose the time slice for the delivery
- we need to set how many products we can deliver for each time slot.
- when the selected time slot is full, customer can't choose it.

Is there a way to do it?
Should we continue using variants to allow people selecting the desired time slot?
Can we work on order to reach our goal?

Thank you in advance for your help.

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

  • Posts: 83933
  • Thank you received: 13588
  • MODERATOR
8 years 8 months ago #250146

Hi,

I don't think that variants are adapted to what you want since it forces the customer to choose the delivery time for each product in his cart, and thus it can set different time slots for different products in the same cart.
Also, the limiting factor is not the number of products you want to deliver per slot, but the number of deliveries, if I understand correctly. Whether the customer orders 1 or 2 products in his order, it counts for one slot in the time period, no ?
So in regards to all that, it seems more logical to do that at the order level with a custom field of the table "order".

Now regarding the limitation of orders per slot, there is no option to do that.
It will require the development of a custom plugin.
Were I to work on that custom development, I would create a new type of custom field implementing the fields API:
www.hikashop.com/support/documentation/6...entation.html#fields
We have an example of such plugin with the 'advanced date picker' that can be found in plugins/hikashop/datepickerfield/
It would only require one MySQL query to load the number of slots already ordered in each time period and then a few lines of code to generate the time options in the dropdown based on that query results.

If you're not a developer, you can contact our partners:
www.hikashop.com/home/our-partners.html

The following user(s) said Thank You: Lippo

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

  • Posts: 22
  • Thank you received: 1
8 years 8 months ago #250259

Thank you very much Nicolas.

We're developing a custom plugin, as suggested. I've another question about this.

If we filter available time slots when they are displayed, it may occur that when an user is buying (but he/she hasn't complete the process yet), another user select the same time slot (available becaue the first user did not confirm the order yet). In this way that time slot could be overbooked.
Is there a way to prevent this?

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

  • Posts: 83933
  • Thank you received: 13588
  • MODERATOR
8 years 8 months ago #250286

Hi,

You can implement the onBeforeOrderCreate trigger in your plugin and add a final check before the order is created in it so that you are sure that the slot is not overbooked and if it is, cancel the creation of the order with the $do parameter of the trigger:
www.hikashop.com/support/documentation/6...#onBeforeOrderCreate

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

  • Posts: 22
  • Thank you received: 1
8 years 8 months ago #250383

Hi Nicolas,
thank you again for your answer and instructions.

Can we change the $do object in order to block the order and to display an alert to the user? We would like to display a message in which we explain why the order has been blocked. Is that possible? How to do it?

Thank you!

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

  • Posts: 83933
  • Thank you received: 13588
  • MODERATOR
8 years 8 months ago #250423

Hi,

Can we change the $do object in order to block the order
As I said, yes, that's the role of that variable.
And if you want to add a message on the page, you can use the message system of Joomla:
docs.joomla.org/Display_error_messages_and_notices

The following user(s) said Thank You: Lippo

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

Time to create page: 0.065 seconds
Powered by Kunena Forum