【问题标题】:Woocommerce Calculate Shipping MandatoryWoocommerce 必须计算运费
【发布时间】:2018-07-14 10:55:43
【问题描述】:

[IMG]http://i66.tinypic.com/2laagkw.png[/IMG] http://i66.tinypic.com/2laagkw.png

在购物车页面上,我希望计算运费是强制性的。我使用统一运费。客户有时会错过计算运费的链接,然后在不增加运费的情况下继续结账。

然后在“计算运费”链接上方显示“没有可用的运输方式。请检查您的地址或如果您需要任何帮助,请与我们联系。” - 我想删除它或将其更改为其他内容。

[IMG]http://i68.tinypic.com/oqf692.png[/IMG] http://i68.tinypic.com/oqf692.png

然后,当您转到结帐页面时,我默认显示收件人详细信息,但我想删除标题左侧的复选框。它应该始终显示。对此的任何帮助将不胜感激,因为我只是从网页设计开始。

【问题讨论】:

    标签: checkbox woocommerce checkout shipping


    【解决方案1】:
    add_action('wp_head','prevent_proceed_to_checkout');
    function prevent_proceed_to_checkout() { 
    echo '  <script>
                jQuery(function(){  
                    jQuery(".woocommerce-cart .wc-proceed-to-checkout a.checkout-button").on("click",function(e){
                        var _this = this;
                        alert("Please calculate shipping!");
                        e.preventDefault();
                        jQuery(".shipping-calculator-form .button").on("click",function(){
                            jQuery(_this).off();
                        });
                     });
                });
            </script>';
    }
    

    我现在只需要删除复选框。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-03-02
      • 1970-01-01
      • 2021-07-16
      • 1970-01-01
      • 2019-07-29
      • 2019-06-21
      相关资源
      最近更新 更多