1
0
mirror of synced 2024-11-22 13:06:07 +03:00

Merge pull request #15 from iyzoer/v1.9

v1.1.1
This commit is contained in:
Alex Lushpai 2018-09-04 09:58:28 +03:00 committed by GitHub
commit 8def052f47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 134 additions and 133 deletions

View File

@ -154,11 +154,12 @@ class Retailcrm_Retailcrm_Model_Exchange
$customer->setWebsiteId($siteid);
$customer->loadByEmail($order['email']);
if (!is_numeric($customer->getId())) {
$customer
->setGroupId(1)
->setWebsiteId($siteid)
->setStore($storeId)
->setStoreId($storeId)
->setEmail($order['email'])
->setFirstname($order['firstName'])
->setLastname($order['lastName'])
@ -390,7 +391,7 @@ class Retailcrm_Retailcrm_Model_Exchange
$customer
->setGropuId(1)
->setWebsiteId($siteid)
->setStore($storeId)
->setStoreId($storeId)
->setEmail($order['email'])
->setFirstname($order['firstName'])
->setLastname($order['lastName'])

View File

@ -103,7 +103,6 @@ class Retailcrm_Retailcrm_Model_Order extends Retailcrm_Retailcrm_Model_Exchange
}
$product = array(
'productId' => $item->getProductId(),
'productName' => !isset($parent) ? $item->getName() : $parent->getName(),
'quantity' => !isset($parent) ? intval($item->getQtyOrdered()) : intval($parent->getQtyOrdered()),
'initialPrice' => !isset($parent) ? $item->getPrice() : $parent->getPrice(),
@ -116,7 +115,6 @@ class Retailcrm_Retailcrm_Model_Order extends Retailcrm_Retailcrm_Model_Exchange
$items[] = $product;
} elseif ($item->getProductType() == "grouped") {
$product = array(
'productId' => $item->getProductId(),
'productName' => $item->getName(),
'quantity' => $item->getQtyOrdered(),
'initialPrice' => $item->getPrice(),
@ -343,10 +341,12 @@ class Retailcrm_Retailcrm_Model_Order extends Retailcrm_Retailcrm_Model_Exchange
}
$product = array(
'productId' => $item->getProductId(),
'productName' => !isset($parent) ? $item->getName() : $parent->getName(),
'quantity' => !isset($parent) ? intval($item->getQtyOrdered()) : intval($parent->getQtyOrdered()),
'initialPrice' => !isset($parent) ? $item->getPrice() : $parent->getPrice()
'initialPrice' => !isset($parent) ? $item->getPrice() : $parent->getPrice(),
'offer' => array(
'externalId' => $item->getProductId()
)
);
unset($parent);
$items[] = $product;