1
0
mirror of synced 2025-02-11 17:59:26 +03:00

add url product (#21)

This commit is contained in:
azgalot 2017-06-15 11:31:02 +03:00 committed by Alex Lushpai
parent 2c270e3f8e
commit db784de369

View File

@ -298,26 +298,32 @@ class MoySkladICMLParser
'price' => isset($assortiment['salePrices'][0]['value']) ?
(((float)$assortiment['salePrices'][0]['value']) / 100) :
(((float)$assortiment['product']['salePrices'][0]['value']) / 100),
'purchasePrice' => isset($assortiment['buyPrice']['value']) ?
(((float)$assortiment['buyPrice']['value']) / 100) :
(((float)$assortiment['product']['buyPrice']['value']) / 100),
(
isset($assortiment['product']['buyPrice']['value']) ?
(((float)$assortiment['product']['buyPrice']['value']) / 100) :
0
),
'weight' => isset($assortiment['weight']) ?
$assortiment['weight'] :
$assortiment['product']['weight'],
'code' => isset($assortiment['code']) ? (string) $assortiment['code'] : '',
'xmlId' => !empty($assortiment['product']['externalCode']) ?
($assortiment['product']['externalCode'] . '#' . $assortiment['externalCode']) :
$assortiment['externalCode'],
'image' => array(
'content' => isset($image) ? $image : '',
'name' => isset($assortiment['product']['image']['filename']) ? $assortiment['product']['image']['filename'] : '',
'id' => $assortiment['id'],
),
'url' => !empty($assortiment['product']['meta']['uuidHref']) ?
$assortiment['product']['meta']['uuidHref'] :
(
!empty($assortiment['meta']['uuidHref']) ?
$assortiment['meta']['uuidHref'] :
''
)
);
if (isset($assortiment['uom']) && isset($assortiment['uom']['code'])) {
@ -426,7 +432,11 @@ class MoySkladICMLParser
$this->icmlAdd($offerXml, 'purchasePrice', number_format($product['purchasePrice'], 2, '.', ''));
$this->icmlAdd($offerXml, 'name', htmlspecialchars($product['name']));
$this->icmlAdd($offerXml, 'productName', htmlspecialchars($product['productName']));
$this->icmlAdd($offerXml, 'vatRate',$product['effectiveVat']);
$this->icmlAdd($offerXml, 'vatRate', $product['effectiveVat']);
if (!empty($product['url'])) {
$this->icmlAdd($offerXml, 'url', htmlspecialchars($product['url']));
}
if ($product['unit'] != '') {
$unitXml = $offerXml->addChild('unit');