Delivery Pickup Date and Time

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
User avatar
peter69
Posts: 95
Joined: 09 Jun 2022, 19:31

Delivery Pickup Date and Time

Post by peter69 » 20 Sep 2022, 06:57

Hello!

Thank you very much in advance for your support,

I would like to know if there is any guide on how to implement in the checkout process, that the customer can choose the date and time of delivery of your order.

And that these dates and times, can be managed from the admin panel. So that the administrator can enable or disable ranges of days and hours.

Best regards!

User avatar
aimeos
Administrator
Posts: 7873
Joined: 01 Jan 1970, 00:00

Re: Delivery Pickup Date and Time

Post by aimeos » 21 Sep 2022, 07:03

Use the Time service decorator which offers that feature:
https://aimeos.org/docs/latest/manual/s ... tors/#time
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
peter69
Posts: 95
Joined: 09 Jun 2022, 19:31

Re: Delivery Pickup Date and Time

Post by peter69 » 30 Sep 2022, 17:58

Hello Sir,

Thank you very much for your prompt reply,

I did the test with what you indicated, however it is not exactly what I need.

What we need is for the customer to be able to choose ranges of hours available to receive delivery (these ranges of hours must be previously configured/enabled beforehand by the administrator):
wc-od-checkout-time-frame-png-446×305- (1).png
wc-od-checkout-time-frame-png-446×305- (1).png (57.48 KiB) Viewed 1845 times
Also for ensuring that the store can process all orders by limiting the number of orders per day or per time period.

Attached is a demo image,

Again, thank you very much for any help you can give me.

Best regards!
Attachments
wc-od-checkout-time-frame.png
wc-od-checkout-time-frame.png (57.48 KiB) Viewed 1845 times

User avatar
aimeos
Administrator
Posts: 7873
Joined: 01 Jan 1970, 00:00

Re: Delivery Pickup Date and Time

Post by aimeos » 03 Oct 2022, 07:07

You can implement your own service provider decorator that behaves exactly as you want. Use the existing one as reference:
https://github.com/aimeos/aimeos-core/b ... r/Time.php

Here you can see how decorators work:
https://aimeos.org/docs/latest/provider ... ecorators/

Check this for defining the configuration you need:
https://aimeos.org/docs/latest/provider ... figuration
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
peter69
Posts: 95
Joined: 09 Jun 2022, 19:31

Re: Delivery Pickup Date and Time

Post by peter69 » 11 Nov 2022, 16:46

Hello Sir,

I keep trying to implement this feature, but I have not been able to do it yet. I am not sure what is the correct/recommended way to do it.

The idea is to define "Time slots" and in each time slot to be able to define a "delivery capacity". Then in the frontend disable the time slots that have reached the "delivery capacity".

Each slot must have as configuration: delivery capacity, start time and end time.

I have tried to add the functionality of the time slots with a decorator as you indicated, but however in the configuration part only allows option and value.

I would be very grateful if you could guide me or give me suggestions on how to implement these features,

Attached is an image of the features I wish to implement.

Thank you very much for your time and for the help you can give me,

Best regards!
Attachments
delivery date and time slots .png
delivery date and time slots .png (110.13 KiB) Viewed 1691 times

User avatar
aimeos
Administrator
Posts: 7873
Joined: 01 Jan 1970, 00:00

Re: Delivery Pickup Date and Time

Post by aimeos » 12 Nov 2022, 05:40

The configuration is more complex than just a simple key/value pair but you can create a multi-dimensional configuration like:

Code: Select all

slots: {
	0: {
		capacity: 205,
		begin: '09:00',
		end: '14:30'
	},
	1: {
		capacity: 230,
		begin: '14:00',
		end: '19:00'
	}
	// ...
}
The keys would be "slots/0", "slots/1" and so on. You can also add a custom VueJS component so the input fields look like in your example but the stored configuration will be a PHP array like outlined above in your decorator.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
peter69
Posts: 95
Joined: 09 Jun 2022, 19:31

Re: Delivery Pickup Date and Time

Post by peter69 » 12 Nov 2022, 06:21

Hello!

So it means that in the decorator the configuration must be defined as follows?:

Code: Select all

private $beConfig = array(
		'delivery.slots' => array(
			'code' => 'delivery.slots',
			'internalcode' => 'delivery.slots',
			'label' => 'Delivery time slots',
			'type' => 'map',
			'internaltype' => 'array',
			'default' => [],
			'required' => false,
		),
);
Also, the "slot" that the customer chooses will be saved in the order?

If so, then is it possible to disable a time slot in case it has reached the delivery capacity limit via

Code: Select all

$manager->search();
?

Thank you very much for your kind help,

Best regards!

User avatar
aimeos
Administrator
Posts: 7873
Joined: 01 Jan 1970, 00:00

Re: Delivery Pickup Date and Time

Post by aimeos » 12 Nov 2022, 18:58

peter69 wrote: 12 Nov 2022, 06:21

Code: Select all

private $beConfig = array(
		'delivery.slots' => array(
			'code' => 'delivery.slots',
			// ...
		),
);
This would allow you to enter something like this in the existing config section of the service backend:

Code: Select all

delivivery.slots => [
	'capacity' => 100,
	'begin' => '09:00',
	'end' => '14:30',
]
But you need a list of mappings and this can't be configured by the current VueJS config component implementation. The best option would be to create a custom VueJS component for your data structure.
peter69 wrote: 12 Nov 2022, 06:21 Also, the "slot" that the customer chooses will be saved in the order?
By default, only a key and value is stored in the mshop_order_base_service_attr table but in your decorator, you can also set more complex values as JSON encoded string using th setAttributes() method:
https://aimeos.org/docs/latest/provider ... store-data
peter69 wrote: 12 Nov 2022, 06:21 If so, then is it possible to disable a time slot in case it has reached the delivery capacity limit via

Code: Select all

$manager->search();
?
Yes, the getConfigFE() method returns what is shown in the frontend. You can filter what's not available any more in that method.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
peter69
Posts: 95
Joined: 09 Jun 2022, 19:31

Re: Delivery Pickup Date and Time

Post by peter69 » 01 Dec 2022, 06:54

Hello aimeos,

I have already added the vue component that displays the time slots. Now I would like to know what is the name I should give to the input where the JSON containing the time slots is saved.

I know that the configurations consist of key and value, but in this case how should I name the input to save the configurations?

Regards,

User avatar
peter69
Posts: 95
Joined: 09 Jun 2022, 19:31

Re: Delivery Pickup Date and Time

Post by peter69 » 01 Dec 2022, 21:25

I attach a screenshot where you can see the component I have created and also the settings I have configured in my delivery service provider.

I know that the configurations are saved as key/value, but I don't know what names I should give to the inputs so that they are saved correctly.
Attachments
service-delivey-capacity-custom-config.png
service-delivey-capacity-custom-config.png (99.08 KiB) Viewed 1566 times
service delivery config-min.png
service delivery config-min.png (77.04 KiB) Viewed 1566 times

Post Reply