Woocommerce - 根据一天中的时间禁用某些运输方式 [英] Woocommerce - disable certain shipping methods based on time of day

查看:53
本文介绍了Woocommerce - 根据一天中的时间禁用某些运输方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在一天中的某些时间禁用我的一种运输方式,但似乎找不到能够这样做的插件.

I'm trying to disable one of my shipping methods during certain times of day and can't seem to find a plugin capable of doing so.

因此,最简单的形式可能是一个 if 语句,例如:

So in the simplest form possible it would be an if statement something like:

$time = date("H");
$timezone = date("e");

if($time < "9" || $time > "21") {

    $shippingmethod1.disable();

}

我不知道从哪里开始添加此功能.

I don't know where to start about adding this functionality.

任何帮助将不胜感激.

推荐答案

找到了一个完全满足我需要的插件 https://www.simbaho​​sting.co.uk/s3/product/woocommerce-opening-hours-delivery-times/?attribute_licence-type=Single+site+licence+%28%C2%A335%29

Found a plugin that does exactly what I need it to https://www.simbahosting.co.uk/s3/product/woocommerce-opening-hours-delivery-times/?attribute_licence-type=Single+site+licence+%28%C2%A335%29

这篇关于Woocommerce - 根据一天中的时间禁用某些运输方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆