- Posts: 28
- Thank you received: 0
dynamic delivery date and time, depending on shipping mode
6 years 3 months ago #320363
by retiro
dynamic delivery date and time, depending on shipping mode was created by retiro
-- HikaShop version -- : 4.3.0
-- Joomla version -- : 3.9.18
-- PHP version -- : 7.2.11
-- Browser(s) name and version -- : any
Hello,
I would like to use custom fields for delivery date and delivery time on my orders. However, I want the customers to only be able to choose from specific times, which should be configurable in the backend and will be different depending on the chosen shipping mode. Specifically, I have the se 2 shipping modes:
- Home delivery: We only deliver on tuesdays and thursdays between 9:00 and 12:00. User should only be able to choose within these times
- Pickup on site: We have fixed times where customers can come to our location and pick up the goods, which will then be ready packaged for them already (its all fresh goods)
I want to be able to configure these times offline, not hard code them. How do I proceed?
regards
-- Joomla version -- : 3.9.18
-- PHP version -- : 7.2.11
-- Browser(s) name and version -- : any
Hello,
I would like to use custom fields for delivery date and delivery time on my orders. However, I want the customers to only be able to choose from specific times, which should be configurable in the backend and will be different depending on the chosen shipping mode. Specifically, I have the se 2 shipping modes:
- Home delivery: We only deliver on tuesdays and thursdays between 9:00 and 12:00. User should only be able to choose within these times
- Pickup on site: We have fixed times where customers can come to our location and pick up the goods, which will then be ready packaged for them already (its all fresh goods)
I want to be able to configure these times offline, not hard code them. How do I proceed?
regards
Please Log in or Create an account to join the conversation.
6 years 3 months ago - 6 years 3 months ago #320385
by nicolas
Replied by nicolas on topic dynamic delivery date and time, depending on shipping mode
Hi,
I don't see a way of doing that with the options available.
That would require some development in the core of HikaShop to add an option to be able to restrict the custom field on the shipping methods. That way, you could have two sets of custom fields you could configure independently from one another, with each set restricted to the corresponding shipping method.
I don't see a way of doing that with the options available.
That would require some development in the core of HikaShop to add an option to be able to restrict the custom field on the shipping methods. That way, you could have two sets of custom fields you could configure independently from one another, with each set restricted to the corresponding shipping method.
Last edit: 6 years 3 months ago by nicolas.
Please Log in or Create an account to join the conversation.
6 years 3 months ago #320422
by retiro
Replied by retiro on topic dynamic delivery date and time, depending on shipping mode
what about adding API that would allow me to inspect the order status and decide whether a custom field is applicable?
And what about being able to feed selectable dates into the delivery date calendar. Is that possible now, or would it require API similar to the above?
If both is yes, can that API be added? When?
And what about being able to feed selectable dates into the delivery date calendar. Is that possible now, or would it require API similar to the above?
If both is yes, can that API be added? When?
Please Log in or Create an account to join the conversation.
6 years 3 months ago #320435
by nicolas
Replied by nicolas on topic dynamic delivery date and time, depending on shipping mode
Hi,
The order status ? I suppose that you mean the shipping method. Because the order status is not yet known on the checkout.
You can already do that with the Fields API :
www.hikashop.com/support/documentation/6...entation.html#fields
You can actually look at the plugin plugins/hikashop/datepickerfield/ on your website for an example.
You could do a copy of that plugin to create your own type of date picker custom field. That way, you could feed to the field the selectable dates. And for the restriction to the shipping method, you could do it with the onHikashopBeforeDisplayView trigger
www.hikashop.com/support/documentation/6...hopBeforeDisplayView to remove fields from the checkout fields view based on the shipping method selected. If the fields are required, you'll also want to change the "check" function of the custom field type to handle the shipping method selected.
You'll have to also add some javascript to force the refresh of the custom field area when the shipping method is changed if they are both on the same step of the checkout. We also have a trigger when the shipping method is changed to allow you to refresh the view area (or maybe just do a full refresh of the page ?)
The order status ? I suppose that you mean the shipping method. Because the order status is not yet known on the checkout.
You can already do that with the Fields API :
www.hikashop.com/support/documentation/6...entation.html#fields
You can actually look at the plugin plugins/hikashop/datepickerfield/ on your website for an example.
You could do a copy of that plugin to create your own type of date picker custom field. That way, you could feed to the field the selectable dates. And for the restriction to the shipping method, you could do it with the onHikashopBeforeDisplayView trigger
www.hikashop.com/support/documentation/6...hopBeforeDisplayView to remove fields from the checkout fields view based on the shipping method selected. If the fields are required, you'll also want to change the "check" function of the custom field type to handle the shipping method selected.
You'll have to also add some javascript to force the refresh of the custom field area when the shipping method is changed if they are both on the same step of the checkout. We also have a trigger when the shipping method is changed to allow you to refresh the view area (or maybe just do a full refresh of the page ?)
Code:
window.Oby.registerAjax(['checkout.shipping.updated'], function(params){
// shipping method is being changed
});
Please Log in or Create an account to join the conversation.
5 months 1 week ago #371546
by nicolas
Replied by nicolas on topic dynamic delivery date and time, depending on shipping mode
Hi,
For anyone reading this, custom order fields can now be restricted to shipping methods in HikaShop.
For anyone reading this, custom order fields can now be restricted to shipping methods in HikaShop.
Please Log in or Create an account to join the conversation.
Time to create page: 0.219 seconds