mirror of
https://github.com/retailcrm/prestashop-module.git
synced 2025-03-03 19:53:19 +03:00
correct generate icml (#16)
This commit is contained in:
parent
9bbe23195c
commit
ee33a5fb40
@ -32,7 +32,7 @@ foreach ($customerRecords as $record) {
|
|||||||
$customers[$record['id_customer']] = array(
|
$customers[$record['id_customer']] = array(
|
||||||
'externalId' => $record['id_customer'],
|
'externalId' => $record['id_customer'],
|
||||||
'firstName' => $record['firstname'],
|
'firstName' => $record['firstname'],
|
||||||
'lastname' => $record['lastname'],
|
'lastName' => $record['lastname'],
|
||||||
'email' => $record['email']
|
'email' => $record['email']
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ class RetailcrmCatalog
|
|||||||
|
|
||||||
$currencies = Currency::getCurrencies();
|
$currencies = Currency::getCurrencies();
|
||||||
|
|
||||||
$types = Category::getCategories($id_lang, true, false);
|
$types = Category::getCategories($id_lang, false, false);
|
||||||
foreach ($types AS $category) {
|
foreach ($types AS $category) {
|
||||||
$categories[] = array(
|
$categories[] = array(
|
||||||
'id' => $category['id_category'],
|
'id' => $category['id_category'],
|
||||||
@ -126,6 +126,11 @@ class RetailcrmCatalog
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!empty($combinations[0]['reference'])) {
|
||||||
|
$articleCombination = $combinations[0]['reference'];
|
||||||
|
} else {
|
||||||
|
$articleCombination = null;
|
||||||
|
}
|
||||||
$pictures = array();
|
$pictures = array();
|
||||||
$covers = Image::getImages($id_lang, $product['id_product'], $offer['id_product_attribute']);
|
$covers = Image::getImages($id_lang, $product['id_product'], $offer['id_product_attribute']);
|
||||||
foreach($covers as $cover) {
|
foreach($covers as $cover) {
|
||||||
@ -140,7 +145,8 @@ class RetailcrmCatalog
|
|||||||
}
|
}
|
||||||
|
|
||||||
$offerPrice = Combination::getPrice($offer['id_product_attribute']);
|
$offerPrice = Combination::getPrice($offer['id_product_attribute']);
|
||||||
$offerPrice = $offerPrice > 0 ? $offerPrice : $price;
|
//$offerPrice = $offerPrice > 0 ? $offerPrice : $price;
|
||||||
|
$offerPrice = $offerPrice != 0 ? $offerPrice + $price : $price;
|
||||||
|
|
||||||
$item = array(
|
$item = array(
|
||||||
'id' => $product['id_product'] . '#' . $offer['id_product_attribute'],
|
'id' => $product['id_product'] . '#' . $offer['id_product_attribute'],
|
||||||
@ -155,9 +161,12 @@ class RetailcrmCatalog
|
|||||||
'purchasePrice' => $purchasePrice,
|
'purchasePrice' => $purchasePrice,
|
||||||
'price' => round($offerPrice, 2),
|
'price' => round($offerPrice, 2),
|
||||||
'vendor' => $vendor,
|
'vendor' => $vendor,
|
||||||
'article' => $article,
|
'article' => ($articleCombination) ? $articleCombination : $article,
|
||||||
'weight' => $weight,
|
'weight' => $weight,
|
||||||
'size' => $size
|
'size' => $size,
|
||||||
|
'width' => $width,
|
||||||
|
'height' => $height,
|
||||||
|
'depth' => $depth
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!empty($combinations)) {
|
if (!empty($combinations)) {
|
||||||
@ -197,7 +206,10 @@ class RetailcrmCatalog
|
|||||||
'vendor' => $vendor,
|
'vendor' => $vendor,
|
||||||
'article' => $article,
|
'article' => $article,
|
||||||
'weight' => $weight,
|
'weight' => $weight,
|
||||||
'size' => $size
|
'size' => $size,
|
||||||
|
'width' => $width,
|
||||||
|
'height' => $height,
|
||||||
|
'depth' => $depth
|
||||||
);
|
);
|
||||||
|
|
||||||
$items[] = $item;
|
$items[] = $item;
|
||||||
|
@ -33,7 +33,10 @@ class RetailcrmIcml
|
|||||||
'color' => 'Цвет',
|
'color' => 'Цвет',
|
||||||
'weight' => 'Вес',
|
'weight' => 'Вес',
|
||||||
'size' => 'Размер',
|
'size' => 'Размер',
|
||||||
'tax' => 'Наценка'
|
'tax' => 'Наценка',
|
||||||
|
'width' => 'Ширина',
|
||||||
|
'height' => 'Высота',
|
||||||
|
'depth' => 'Глубина'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,14 +78,14 @@ class RetailcrmIcml
|
|||||||
foreach ($categories as $category) {
|
foreach ($categories as $category) {
|
||||||
$e = $this->eCategories->appendChild(
|
$e = $this->eCategories->appendChild(
|
||||||
$this->dd->createElement(
|
$this->dd->createElement(
|
||||||
'category', $category['name']
|
'category', htmlspecialchars($category['name'])
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$e->setAttribute('id', $category['id']);
|
$e->setAttribute('id', $category['id']);
|
||||||
|
|
||||||
if ($category['parentId'] > 0) {
|
if ($category['parentId'] > 0) {
|
||||||
$e->setAttribute('parentId', $category['parentId']);
|
$e->setAttribute('parentId', htmlspecialchars($category['parentId']));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,8 +20,7 @@ class RetailCRM extends Module
|
|||||||
{
|
{
|
||||||
$this->name = 'retailcrm';
|
$this->name = 'retailcrm';
|
||||||
$this->tab = 'export';
|
$this->tab = 'export';
|
||||||
$this->version = '2.1.1';
|
$this->version = '2.2';
|
||||||
$this->version = '2.1';
|
|
||||||
$this->author = 'Retail Driver LCC';
|
$this->author = 'Retail Driver LCC';
|
||||||
$this->displayName = $this->l('RetailCRM');
|
$this->displayName = $this->l('RetailCRM');
|
||||||
$this->description = $this->l('Integration module for RetailCRM');
|
$this->description = $this->l('Integration module for RetailCRM');
|
||||||
@ -454,9 +453,7 @@ class RetailCRM extends Module
|
|||||||
'properties' => $arProp
|
'properties' => $arProp
|
||||||
);
|
);
|
||||||
|
|
||||||
unset($arAttr);
|
unset($arAttr, $count, $arProp);
|
||||||
unset($count);
|
|
||||||
unset($arProp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$deliveryCode = $params['order']->id_carrier;
|
$deliveryCode = $params['order']->id_carrier;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user