public function make_level_expire($order_id=0){
/*
* @param int
* @return none
*/
if ($order_id){
$order = new WC_Order($order_id);
$items = $order->get_items();
$uid = $order->get_user_id();
if ($uid){
foreach ($items as $item){
$lid = get_post_meta($item['product_id'], 'iump_woo_product_level_relation', TRUE);
if ($lid!==FALSE && $lid!=-1 && $lid!=''){
$product_id = $item['product_id'];
$new_status = $order->get_status();
$txn_id = 'woocommerce_order_' . $order_id . '_' . $lid;
$ihc_order_id = Ihc_Db::get_order_id_by_meta_value_and_meta_type('txn_id', $txn_id);
Ihc_Db::update_order_status($ihc_order_id, $new_status);
Ihc_Db::update_transaction_status($txn_id, $new_status);
ihc_make_level_expire_for_user($uid, $lid);
}
}
}
}
}
/*указание на строку 195 $txn_id = 'woocommerce_order_' . $order_id . '_' . $lid;*/