dynamic delivery date and time, depending on shipping mode

  • Posts: 28
  • Thank you received: 0
4 years 5 months ago #320363

-- 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

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
4 years 5 months ago #320385

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.

Last edit: 4 years 5 months ago by nicolas.

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

  • Posts: 28
  • Thank you received: 0
4 years 5 months ago #320422

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?

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
4 years 5 months ago #320435

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 ?)

window.Oby.registerAjax(['checkout.shipping.updated'], function(params){
// shipping method is being changed
});

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

Time to create page: 0.062 seconds
Powered by Kunena Forum