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