hi,
thanks for your help.
I followed your advice and changed the code, but no order is created. This is the modified code:
foreach ($order_details as $details) {
$erp_product_id = $product->check_specific_product($details['product_id'],$details['product_attribute_id'],$userId, $client);
$total_price = $details['unit_price_tax_excl'];
$reduction_rate_tax_excl='0';
$tax_id = Db::getInstance()->getRow("SELECT `id_tax` from `" . _DB_PREFIX_ . "order_detail_tax` where `id_order_detail`=" . $details['id_order_detail'] . "");
if ($tax_id['id_tax'] > 0) {
$erp_tax_id = $tax->check_specific_tax($tax_id['id_tax'], $client, $userId);
}
else
$erp_tax_id = -1;
$line_array[$i]=new xmlrpcval(array(
'type' => new xmlrpcval('Product', "string"),
'product_id' => new xmlrpcval($erp_product_id, "int"),
'price_unit' => new xmlrpcval($total_price, "string"),
'product_uom_qty' => new xmlrpcval($details['product_quantity'], "string"),
'name' => new xmlrpcval(str_replace('+', ' ',urlencode($details['product_name'])), "string"),
'discount' => new xmlrpcval($reduction_rate_tax_excl, "string"),
'tax_id' => array(array(6, 0, array('1', '24'))),
),"struct");
$i = $i+1;
}
$msg1 = new xmlrpcmsg('execute');
$msg1->addParam(new xmlrpcval(Configuration::getGlobalValue("ErpDatabase"), "string"));
$msg1->addParam(new xmlrpcval($userId, "int"));
$msg1->addParam(new xmlrpcval(Configuration::getGlobalValue("ErpPassword"), "string"));
$msg1->addParam(new xmlrpcval("force.done", "string"));
$msg1->addParam(new xmlrpcval("create_n_confirm_order", "string"));
$msg1->addParam(new xmlrpcval($order_data, "struct"));
$msg1->addParam(new xmlrpcval($line_array, "array"));
$response = $client->send($msg1);