[英]Woocommerce - disable «proceed to checkout» button in cart page
I am currently trying to figure out a way to disable the « proceed to checkout » button for a specific situation: Some oversize products can cannot be shipped to certain countries, unless the client asks for a quote first.我目前正在尝试找出一种方法,在特定情况下禁用“继续结帐”按钮:某些大件产品无法运送到某些国家/地区,除非客户先询问报价。
I added a function in functions.php
that detects these oversized products.我在
functions.php
中添加了一个函数来检测这些超大产品。
In the cart-shipping.php
and cart-totals.php
, I can't find the point where I should add the:在
cart-shipping.php
和cart-totals.php
,我找不到应该添加的点:
remove_action(woocommerce_proceed_to_checkout','woocommerce_button_proceed_to_checkout', 20);
Is it possible to help?有没有可能提供帮助?
Thank you in advance先感谢您
This worked for me.这对我有用。
remove_action( 'woocommerce_proceed_to_checkout',
'woocommerce_button_proceed_to_checkout', 20);
I added to woocommerce\\templates\\cart\\proceed-to-checkout-button.php
a style: style="display:none"
.. seems working for me.我添加到
woocommerce\\templates\\cart\\proceed-to-checkout-button.php
一个 style: style="display:none"
.. 似乎对我woocommerce\\templates\\cart\\proceed-to-checkout-button.php
。
a href="<?php echo esc_url( wc_get_checkout_url() );?>" class="checkout-button
button alt wc-forward" style="display:none"
We can also hide this button by CSS code.我们也可以通过 CSS 代码隐藏这个按钮。
a.checkout-button.button.alt.wc-forward {
display: none;}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.