简体   繁体   English

Woocommerce - 禁用购物车页面中的“继续结账”按钮

[英]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.phpcart-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.

相关问题 Woocommerce-“进入结帐”按钮进入虚假页面 - Woocommerce - “proceed to checkout” button takes to false page 避免继续结帐按钮文本刷新到 WooCommerce 购物车页面中的默认文本 - Avoid proceed-to-checkout-button text refreshing to default text in WooCommerce cart page 根据 WooCommerce 购物车总数删除“继续结帐”按钮 - Remove "proceed to checkout" button based on WooCommerce cart total 禁用购物车页面,但将结帐页面保留在Woocommerce中 - Disable cart page but keep the checkout page in Woocommerce Woocommerce-在页面加载时,将产品添加到购物车并自动进行结帐 - Woocommerce - On page load, add product to cart and proceed to Checkout automatically 如何将继续进行到结帐-购物车woocommerce - How to move Proceed to checkout - cart woocommerce 在购物车物品库存问题上禁用 WooCommerce 下订单结帐按钮 - On cart items stock issue disable WooCommerce Place order checkout button 将添加到购物车按钮重定向到 WooCommerce 中 1 个特定登录页面的结帐页面 - Redirect add to cart button to checkout page for 1 specific landing page in WooCommerce 更改“继续付款”按钮位置Woocommerce - Change “Proceed To Checkout” Button Location Woocommerce 在结帐时添加一个按钮以清空购物车并重定向到Woocommerce中的商店页面 - Add a button in checkout to empty cart and redirect to shop page in Woocommerce
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM