Open sreekanth236 opened 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); } `
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()){
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); } `