'; $req .=''; $req .=''; $req.=''; $req .= ''; $req .= ''; $str_replace = ''; $action = "http://www.interactive-studios.net/qlmweb/GetActivationKeyWithExpiryDate"; /** ** **PTRS END ADD ** **/ foreach ($items as $item) : // Get/prep product data $_product = $order->get_product_from_item( $item ); $item_meta = new WC_Order_Item_Meta( $item['item_meta'] ); $image = ($show_image) ? 'Product Image' : ''; ?> get_sku()) ? ' (#' . $_product->get_sku() . ')' : ''; // File URLs if ( $show_download_links && $_product->exists() && $_product->is_downloadable() ) { $download_file_urls = $order->get_downloadable_file_urls( $item['product_id'], $item['variation_id'], $item ); $i = 0; foreach ( $download_file_urls as $file_url => $download_file_url ) { echo '
'; $filename = woocommerce_get_filename_from_url( $file_url ); if ( count( $download_file_urls ) > 1 ) { echo sprintf( __('Download %d:', 'woocommerce' ), $i + 1 ); } elseif ( $i == 0 ) echo __( 'Download:', 'woocommerce' ); echo ' ' . $filename . ''; $i++; } } // Variation echo ($item_meta->meta) ? '
' . nl2br( $item_meta->display( true, true ) ) . '' : '
'; ?> status == 'completed'){ if (__( 'Download:', 'woocommerce' ) == 'Download:') echo 'Activation key:
'; else echo "Clef d'activation:
"; $wsdl = "https://quicklicensemanager.com/protraining-systems/qlm7/qlmservice.asmx?WSDL"; $url_qlm = $_product->get_attribute('qlm_url'); $maintenance = $_product->get_attribute('maintenance_plan'); $qlm_params_custom = array( 'orderId' => 'OrderId='.$order->id, 'mail' => 'Customer_Email='.$order->billing_email, 'fullName' => 'Customer_Name='. str_replace(' ','%20',$order->billing_first_name) . '%20' . str_replace(' ','%20',$order->billing_last_name), 'company' => 'Customer_Company='. str_replace(' ','%20',$order->billing_company), 'address1' => 'Customer_Address_1='. str_replace(' ','%20',$order->billing_address_1), 'address2' => 'Customer_Address_2='. str_replace(' ','%20',$order->billing_address_2), 'city' => 'Customer_City='. str_replace(' ','%20',$order->billing_city), 'state' => 'Customer_State='. str_replace(' ','%20',$order->billing_state), 'zip' => 'Customer_Zip='. str_replace(' ','%20',$order->billing_postcode), 'country' => 'Customer_Country='. str_replace(' ','%20',$order->billing_country), 'phone' => 'Customer_Phone='. str_replace(' ','%20',$order->billing_phone), 'quantity' => 'is_quantity='. $item['qty'], 'maintenance' => $maintenance ); $url = $wsdl . $url_qlm; if($url_qlm != ''){ foreach($qlm_params_custom as $key => $value) if ($value != '') $url = $url . '&' . $value; $key_genrated = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM ".$wpdb->prefix . "woocommerce_order_itemmeta WHERE order_item_id = " . $item["item_meta"]['_id'][0] . " AND meta_key = '_activation_key'",ARRAY_A)); if ($key_genrated == 0){ $flux_xml = $client->__doRequest($req,$url,$action,1); echo ''.$flux_xml.''; $key = str_replace($str_replace,"", $flux_xml); $wpdb->insert( $wpdb->prefix . "woocommerce_order_itemmeta", array( 'meta_key' => '_activation_key', 'meta_value' => $key, 'order_item_id' => $item["item_meta"]['_id'][0] ), array( '%s', '%s', '%d' ) ); } else{ $ordermeta = $wpdb->get_row( $wpdb->prepare("SELECT * FROM ".$wpdb->prefix . "woocommerce_order_itemmeta WHERE order_item_id = " . $item["item_meta"]['_id'][0] . " AND meta_key = '_activation_key'", ARRAY_A )); echo ''.$ordermeta->meta_value . ''; } } } } ?> get_formatted_line_subtotal( $item ); ?> id, '_purchase_note', true)) : ?>