From ff2da038b49edde901b950f96b5a2a0ef6e1dd81 Mon Sep 17 00:00:00 2001 From: Dmitry Mamontov Date: Tue, 21 Jul 2015 11:13:59 +0300 Subject: [PATCH] add new param --- MoySkladICMLParser.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/MoySkladICMLParser.php b/MoySkladICMLParser.php index f62d3a1..b76ce94 100644 --- a/MoySkladICMLParser.php +++ b/MoySkladICMLParser.php @@ -357,6 +357,9 @@ class MoySkladICMLParser 'vendor' => $vendorUuid && isset($vendors[$vendorUuid]) ? $vendors[$vendorUuid] : '', 'categoryId' => $categoryId, + 'url' => "https://online.moysklad.ru/app/#good/edit?id={$uuid}", + 'code' => (string) $v->code, + 'weight' => (string) $v[0]['weight'], 'offers' => array(), ); @@ -619,7 +622,20 @@ class MoySkladICMLParser if ($product['article']) { $art = $this->icmlAdd($offerXml, 'param', $product['article']); - $art->addAttribute('name', 'article'); + $art->addAttribute('code', 'article'); + $art->addAttribute('name', 'Артикул'); + } + + if ($product['weight']) { + $wei = $this->icmlAdd($offerXml, 'param', $product['weight']); + $wei->addAttribute('code', 'weight'); + $wei->addAttribute('name', 'Вес'); + } + + if ($product['code']) { + $cod = $this->icmlAdd($offerXml, 'param', $product['code']); + $cod->addAttribute('code', 'code'); + $cod->addAttribute('name', 'Код'); } if ($product['vendor']) {