Run Function After Click Order Place Button

  add_action( 'woocommerce_checkout_order_processed', 'after_submit_place_btn', 10, 1 );

    function after_submit_place_btn(){

       $shipping           = new \WC_Shipping();

    $total_shipping = $shipping->get_shipping_classes();

    // $total_shipping = $shipping->get_cost();

        $value = WC()->cart->cart_contents_total;

       // $total_shipping = WC()->session->get( 'shipping_cost' );

        // $total_shipping = WC()->cart->calculate_shipping();

        setcookie('SHIPPINGJM', $total_shipping,'/');

        setcookie('PRICEJM', $value,'/');

    }

Comments

Popular posts from this blog

Battery discharging formula

HTML CSS JS Animated Sidebar Menu