From 607275d9c03efc0477fbec3cab237242863d6d25 Mon Sep 17 00:00:00 2001 From: Rain2o Date: Thu, 4 Jul 2019 18:25:42 +0200 Subject: [PATCH] Added option to disable unique url keys for categories in mage2vs import. --- CHANGELOG.md | 1 + scripts/mage2vs.js | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa9af49a..07be8d59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Constant for Mailchimp subscription status - @KonstantinSoelch (#294) +- mage2vs import now has optional `--generate-unique-url-keys` parameter which defaults to `false` to enable/disable the url key generation with name and id for categories - @rain2o (#232) ### Fixed - The `product.price_*` fields have been normalized with the backward compatibility support (see `config.tax.deprecatedPriceFieldsSupport` which is by default true) - @pkarw (#289) diff --git a/scripts/mage2vs.js b/scripts/mage2vs.js index 691fe5f7..e233c5f9 100644 --- a/scripts/mage2vs.js +++ b/scripts/mage2vs.js @@ -128,6 +128,7 @@ program .option('--skip-products ', 'skip import of products', false) .option('--skip-pages ', 'skip import of cms pages', false) .option('--skip-blocks ', 'skip import of cms blocks', false) + .option('--generate-unique-url-keys ', 'generate unique url keys for categories', false) .action((cmd) => { let magentoConfig = getMagentoDefaultConfig(cmd.storeCode) @@ -169,7 +170,9 @@ program if (cmd.skipBlocks) { magentoConfig.SKIP_BLOCKS = true; } - + + magentoConfig.GENERATE_UNIQUE_URL_KEYS = cmd.generateUniqueUrlKeys; + const env = Object.assign({}, magentoConfig, process.env) // use process env as well console.log('=== The mage2vuestorefront full reindex is about to start. Using the following Magento2 config ===', magentoConfig) @@ -209,7 +212,8 @@ program 'node_modules/mage2vuestorefront/src/cli.js', 'categories', '--removeNonExistent=true', - '--extendedCategories=true' + '--extendedCategories=true', + `--generateUniqueUrlKeys=${magentoConfig.GENERATE_UNIQUE_URL_KEYS}` ], { env: env, shell: true }) } }