varunsridharan / woocommerce-quick-donation

Online Donation Using Woocoomerce. for woocommerce user's
https://wordpress.org/plugins/woocommerce-quick-donation
GNU General Public License v2.0
7 stars 11 forks source link

store donation order status into database #106

Open sreekanth236 opened 4 years ago

sreekanth236 commented 4 years ago

Hi Varun

How to store donation order status into database

`public function save_order_id_db($order_id){ global $woocommerce; if($this->check_donation_exists_cart()){

        $price = intval($woocommerce->session->donation_price);
        $project_id = intval($woocommerce->session->projects);
        $user_id = get_current_user_id(); 
        update_post_meta( $order_id,"_is_donation",true);
        update_post_meta( $order_id,"_project_details",$woocommerce->session->projects);
        WC_QD()->db()->add_db_option($order_id,$project_id,$user_id,$price);
    }
}

public function add_db_option($order_id,$project_id,$user_id,$price){ global $wpdb; $data_c = array('date' => current_time( 'mysql' ),'userid' => $user_id,'donationid' => $order_id,'projectid' => $project_id, 'amount' => $price); $wpdb->insert(WC_QD_TB, $data_c); } `

order-status