add url product (#21)
This commit is contained in:
parent
2c270e3f8e
commit
db784de369
@ -298,26 +298,32 @@ class MoySkladICMLParser
|
|||||||
'price' => isset($assortiment['salePrices'][0]['value']) ?
|
'price' => isset($assortiment['salePrices'][0]['value']) ?
|
||||||
(((float)$assortiment['salePrices'][0]['value']) / 100) :
|
(((float)$assortiment['salePrices'][0]['value']) / 100) :
|
||||||
(((float)$assortiment['product']['salePrices'][0]['value']) / 100),
|
(((float)$assortiment['product']['salePrices'][0]['value']) / 100),
|
||||||
|
|
||||||
'purchasePrice' => isset($assortiment['buyPrice']['value']) ?
|
'purchasePrice' => isset($assortiment['buyPrice']['value']) ?
|
||||||
(((float)$assortiment['buyPrice']['value']) / 100) :
|
(((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']) ?
|
'weight' => isset($assortiment['weight']) ?
|
||||||
$assortiment['weight'] :
|
$assortiment['weight'] :
|
||||||
$assortiment['product']['weight'],
|
$assortiment['product']['weight'],
|
||||||
|
|
||||||
'code' => isset($assortiment['code']) ? (string) $assortiment['code'] : '',
|
'code' => isset($assortiment['code']) ? (string) $assortiment['code'] : '',
|
||||||
|
|
||||||
'xmlId' => !empty($assortiment['product']['externalCode']) ?
|
'xmlId' => !empty($assortiment['product']['externalCode']) ?
|
||||||
($assortiment['product']['externalCode'] . '#' . $assortiment['externalCode']) :
|
($assortiment['product']['externalCode'] . '#' . $assortiment['externalCode']) :
|
||||||
$assortiment['externalCode'],
|
$assortiment['externalCode'],
|
||||||
|
|
||||||
'image' => array(
|
'image' => array(
|
||||||
'content' => isset($image) ? $image : '',
|
'content' => isset($image) ? $image : '',
|
||||||
'name' => isset($assortiment['product']['image']['filename']) ? $assortiment['product']['image']['filename'] : '',
|
'name' => isset($assortiment['product']['image']['filename']) ? $assortiment['product']['image']['filename'] : '',
|
||||||
'id' => $assortiment['id'],
|
'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'])) {
|
if (isset($assortiment['uom']) && isset($assortiment['uom']['code'])) {
|
||||||
@ -428,6 +434,10 @@ class MoySkladICMLParser
|
|||||||
$this->icmlAdd($offerXml, 'productName', htmlspecialchars($product['productName']));
|
$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'] != '') {
|
if ($product['unit'] != '') {
|
||||||
$unitXml = $offerXml->addChild('unit');
|
$unitXml = $offerXml->addChild('unit');
|
||||||
$unitXml->addAttribute('code', $product['unit']['code']);
|
$unitXml->addAttribute('code', $product['unit']['code']);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user