• Resolved coldfire007

    (@coldfire007)


    Add condition if the order product is out of stock, order status still process.

    how to write the code:

    ????
    $count=$wpdb->get_var($wpdb->prepare(“SELECT license_key FROM $wpdb->bff_lmfwc_licenses where ???? order_id() ?????;”));
    ????
    if ( is_a($order, ‘WC_Order’), $count>0 ) {
    // Change order status to “completed”
    $order->update_status( ‘completed’, __(‘Approved by the customer’, ‘woocommerce’) ) ;

    sorry, i don’t know how to write, please help, thanks.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Add condition if the order product is out of stock’ is closed to new replies.