vue-storefront-api
vue-storefront-api copied to clipboard
Import for backwards compatibility
Hi all,
For a project I need to keep the old vue storefront urls format with the url key but without the category id. For example:
/c/my-category
instead of
/c/my-category-3
I basically need to run the mage2vs import whith the parameter generateUniqueUrlKeys set to false.
I haven't found a way to do it except by editing the mage2vs.js script
console.log(' == CATEGORIES IMPORTER ==');
return exec('node', [
'--harmony',
'node_modules/mage2vuestorefront/src/cli.js',
'categories',
'--removeNonExistent=true',
'--extendedCategories=true',
'--generateUniqueUrlKeys=false'
], { env: env, shell: true })
Can I make this parameter configurable (I can do it myself and do a PR)? or does anyone know how to suggest another way to do it without touching the core?
Thanks!
I think this should be added to mage2vs.js either way. Looking at the mage2vuestorefront/src/cli.js function for this, that variable is defaulted to true, and the logic around this value is still checked when creating the url_path that the urlDispatcher uses. So even the new way of creating url paths needs this option.
@rain2o can you propose a PR with this fix please?