commit
8def052f47
@ -60,7 +60,7 @@ class Retailcrm_Retailcrm_Model_Exchange
|
||||
}
|
||||
|
||||
$orderH = isset($response['history']) ? $response['history'] : array();
|
||||
if(count($orderH) == 0) {
|
||||
if (count($orderH) == 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -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'])
|
||||
|
@ -103,25 +103,23 @@ 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(),
|
||||
'offer'=>array(
|
||||
'externalId'=>$item->getProductId()
|
||||
'offer' => array(
|
||||
'externalId' => $item->getProductId()
|
||||
)
|
||||
);
|
||||
|
||||
unset($parent);
|
||||
$items[] = $product;
|
||||
} elseif($item->getProductType() == "grouped") {
|
||||
} elseif ($item->getProductType() == "grouped") {
|
||||
$product = array(
|
||||
'productId' => $item->getProductId(),
|
||||
'productName' => $item->getName(),
|
||||
'quantity' => $item->getQtyOrdered(),
|
||||
'initialPrice' => $item->getPrice(),
|
||||
'offer'=>array(
|
||||
'externalId'=>$item->getProductId()
|
||||
'offer' => array(
|
||||
'externalId '=> $item->getProductId()
|
||||
)
|
||||
);
|
||||
|
||||
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user