If this is your first visit, check our documentation. To post, register or login.
Forums / Built-in Shipping and Payment Modules / Display shipping module based on time

Display shipping module based on time

Started by gsh68 on 12 Oct 2022, 3:04 PM · Views: 1,564

Results 1 to 5 of 5
12 Oct 2022, 3:04 PM
#1
gsh68 avatar

gsh68

Zen Follower

Join Date:
Mar 2011
Posts:
103
Plugin Contributions:
0

Display shipping module based on time

1.57c php, PHP 7.4.30
Is it possible to have shipping modules automatically switch on and off/hidden based on the time/day?
UK Special Delivery weekday only delivery - it's a cloned zones module.
I'd like it to only display from Sunday until Thursday at 1pm.
Currently I'm manually enabling/disabling and sometimes forget.

I am aware that the Big Royal Mail module has this built in but as my current shipping options are all set how I want them don't particularly want to switch over.

Thanks.

14 Oct 2022, 1:16 AM
#2
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Display shipping module based on time

Have to know/ understand what you are going to use as a time zone basis. I mean it is obvious that it relates to your local time but, I'm referring to what time your system thinks it is.

There are also some other considerations, like how strict is the time you are choosing? Is it they have to have finalized the purchase by that point? That they got past the shipping page by that point? Somewhere in between?

What about the turn on point? If they begin checkout and as they are about to confirm the order and the option begins available, do they get redirected back to shipping? Is it made available a few minutes before the allowed time but checkout is prevented until the allowed time?

Etc...

The idea I perceive would be to incorporate the test criteria in the__construct method that if the time falls outside the desired time then disable the method.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

14 Oct 2022, 2:16 PM
#3
brittainmark avatar

brittainmark

Totally Zenned

Join Date:
Apr 2009
Posts:
509
Plugin Contributions:
1

Re: Display shipping module based on time

Have a look at bigroyalmail rmspecialdeliverysat I did something like that, you can find it on github. It will need sone changed for php8.2 which I am currently coding.

Mark Brittain
http:\innerlightcrystals.co.uk\sales\

16 Oct 2022, 8:09 AM
#4
gsh68 avatar

gsh68

Zen Follower

Join Date:
Mar 2011
Posts:
103
Plugin Contributions:
0

Re: Display shipping module based on time

mc12345678:

Have to know/ understand what you are going to use as a time zone basis. I mean it is obvious that it relates to your local time but, I'm referring to what time your system thinks it is.

There are also some other considerations, like how strict is the time you are choosing? Is it they have to have finalized the purchase by that point? That they got past the shipping page by that point? Somewhere in between?

What about the turn on point? If they begin checkout and as they are about to confirm the order and the option begins available, do they get redirected back to shipping? Is it made available a few minutes before the allowed time but checkout is prevented until the allowed time?

Etc...

The idea I perceive would be to incorporate the test criteria in the__construct method that if the time falls outside the desired time then disable the method.

My server time synchs with the local time, according to Server/version info in Admin.
Regarding how strict, currently if the selected shipping method is switched off during checkout, as long as it's past the shipping screen it is still used for the sale. I see no reason to change that.
No redirect if it activates during checkout process.
Cheers.

16 Oct 2022, 8:12 AM
#5
gsh68 avatar

gsh68

Zen Follower

Join Date:
Mar 2011
Posts:
103
Plugin Contributions:
0

Re: Display shipping module based on time

brittainmark:

Have a look at bigroyalmail rmspecialdeliverysat I did something like that, you can find it on github. It will need sone changed for php8.2 which I am currently coding.

I've seen that but I'm just not au fait enough with coding to be able to adapt it.