Avoid checkout for mixed backorder and normal items in Woocommerce

后端 未结 2 1825
一生所求
一生所求 2020-12-21 07:56

Is it possible to disable checkout if there is backorder item mixed with in stock items. The code so far is displaying message if there is mixed items in the cart, but they

2条回答
  •  粉色の甜心
    2020-12-21 08:26

    What about this?

    ...
    if ( es_check_cart_has_backorder_product() ) {
           add_filter('woocommerce_order_button_html', 'sg_remove_payment_button');
    }
    ...
    
    
    function sg_remove_payment_button ($button){
    
    
            $output = '
    '; $output .= 'Sorry, you cannot complete this order'; $output .= '
    '; $output .= ''; return $output; }

提交回复
热议问题