Skip to content

Commit

Permalink
Added product images parsing.
Browse files Browse the repository at this point in the history
  • Loading branch information
dobromyslov committed Aug 20, 2020
1 parent 514ceb1 commit 252a129
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/import-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,17 @@ export class CommerceMlImportParser extends CommerceMlAbstractParser {
description: productXml.Описание
};

if (productXml.Картинка) {
if (Array.isArray(productXml.Картинка)) {
product.images = [];
for (const imagePath of productXml.Картинка) {
product.images.push(imagePath);
}
} else {
product.images = [productXml.Картинка];
}
}

if (productXml.СтавкиНалогов?.СтавкаНалога) {
if (Array.isArray(productXml.СтавкиНалогов?.СтавкаНалога)) {
product.taxRates = [];
Expand Down

0 comments on commit 252a129

Please sign in to comment.