// Merge -> revision 7941
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@7948 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -987,8 +987,10 @@ class eBayRequest
|
||||
{
|
||||
$name = explode(' ', (string)$order->ShippingAddress->Name);
|
||||
$itemList = array();
|
||||
foreach ($order->TransactionArray->Transaction as $transaction)
|
||||
for ($i = 0; isset($order->TransactionArray->Transaction[$i]); $i++)
|
||||
{
|
||||
$transaction = $order->TransactionArray->Transaction[$i];
|
||||
|
||||
$id_product = 0;
|
||||
$id_attribute = 0;
|
||||
$quantity = (string)$transaction->QuantityPurchased;
|
||||
@@ -1007,18 +1009,28 @@ class eBayRequest
|
||||
$itemList[] = array('id_product' => $id_product, 'id_product_attribute' => $id_product_attribute, 'quantity' => $quantity, 'price' => (string)$transaction->TransactionPrice);
|
||||
else
|
||||
{
|
||||
$reference = '-----------------------';
|
||||
$skuItem = (string)$transaction->Item->SKU;
|
||||
$skuVariation = (string)$transaction->Variation->SKU;
|
||||
$customLabel = (string)$transaction->SellingManagerProductDetails->CustomLabel;
|
||||
if ($customLabel != '') $reference = $customLabel;
|
||||
else
|
||||
{
|
||||
if ($skuVariation != '') $reference = $skuVariation;
|
||||
else $reference = $skuItem;
|
||||
}
|
||||
|
||||
|
||||
$id_product = Db::getInstance()->getValue('
|
||||
SELECT `id_product` FROM `'._DB_PREFIX_.'product`
|
||||
WHERE `reference` = \''.pSQL((string)$transaction->item->SKU).'\' OR `reference` = \''.pSQL((string)$transaction->item->CustomLabel).'\' OR `reference` = \''.pSQL((string)$transaction->SellingManagerProductDetails->CustomLabel).'\'
|
||||
OR `reference` = \''.pSQL((string)$transaction->Variation->SKU).'\' OR `reference` = \''.pSQL((string)$transaction->Variation->CustomLabel).'\'');
|
||||
WHERE `reference` = \''.pSQL($reference).'\'');
|
||||
if ((int)$id_product > 0)
|
||||
$itemList[] = array('id_product' => $id_product, 'quantity' => $quantity, 'price' => (string)$transaction->TransactionPrice);
|
||||
else
|
||||
{
|
||||
$row = Db::getInstance()->getValue('
|
||||
SELECT `id_product`, `id_product_attribute` FROM `'._DB_PREFIX_.'product_attribute`
|
||||
WHERE `reference` = \''.pSQL((string)$transaction->item->SKU).'\' OR `reference` = \''.pSQL((string)$transaction->item->CustomLabel).'\' OR `reference` = \''.pSQL((string)$transaction->SellingManagerProductDetails->CustomLabel).'\'
|
||||
OR `reference` = \''.pSQL((string)$transaction->Variation->SKU).'\' OR `reference` = \''.pSQL((string)$transaction->Variation->CustomLabel).'\'');
|
||||
WHERE `reference` = \''.pSQL($reference).'\'');
|
||||
if ((int)$row['id_product'] > 0)
|
||||
$itemList[] = array('id_product' => $row['id_product'], 'id_product_attribute' => $row['id_product_attribute'], 'quantity' => $quantity, 'price' => (string)$transaction->TransactionPrice);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user