woocommerce offtopic - Disable Order Review Page when the id product

how Disable Order Review Page when the id productis 50710 i use this code remove_action( 'woocommerce_checkout_

how Disable Order Review Page when the id product is 50710 i use this code remove_action( 'woocommerce_checkout_order_review', 'woocommerce_order_review', 10 );

but i need disable order review only in id product : 50700

how Disable Order Review Page when the id product is 50710 i use this code remove_action( 'woocommerce_checkout_order_review', 'woocommerce_order_review', 10 );

but i need disable order review only in id product : 50700

Share Improve this question asked Feb 26, 2020 at 15:40 ELEELE 134 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1
function action_woocommerce_checkout_order_review() {
    // Product id
    $product_id = 50700;

    // Generate cart id
    $product_cart_id = WC()->cart->generate_cart_id( $product_id );

    // Is product in cart
    $in_cart = WC()->cart->find_product_in_cart( $product_cart_id );

    // Product found
    if ( $in_cart ) {
       remove_action( 'woocommerce_checkout_order_review', 'woocommerce_order_review', 10 );
    }
}
add_action( 'woocommerce_checkout_order_review', 'action_woocommerce_checkout_order_review', 1, 0 ); 

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744713625a4589487.html

相关推荐

  • woocommerce offtopic - Disable Order Review Page when the id product

    how Disable Order Review Page when the id productis 50710 i use this code remove_action( 'woocommerce_checkout_

    1天前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信