This repository has been archived by the owner on Jun 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added URL Dispatcher URL mapping feature vuestorefront/vue-storefront…
- Loading branch information
Showing
5 changed files
with
48 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,28 @@ | ||
const _slugify = require('./helpers/slugify') | ||
|
||
module.exports = { | ||
|
||
seo: { | ||
useUrlDispatcher: JSON.parse(process.env.SEO_USE_URL_DISPATCHER) || false, | ||
This comment has been minimized.
Sorry, something went wrong.
rain2o
Contributor
|
||
productSlugMapper: (product) => { | ||
let destSlug = '' | ||
if (product.category && product.category.length > 0) { | ||
const firstCat = product.category[0] | ||
destSlug = (firstCat.path ? (firstCat.path) : _slugify(firstCat.name)) + '/' + (product.slug ? product.slug : _slugify(product.name + '-' + product.id)) | ||
} else { | ||
destSlug = (product.slug ? product.slug : _slugify(product.name + '-' + product.id)) | ||
} | ||
destSlug += '.html' | ||
console.log('Dest. product slug = ', destSlug) | ||
return destSlug | ||
}, | ||
categorySlugMapper: (category) => { | ||
const destSlug = (category.url_path ? category.url_path + '/': '') + category.url_key | ||
console.log('Dest. cat slug = ', destSlug) | ||
return destSlug | ||
}, | ||
}, | ||
|
||
magento: { | ||
url: process.env.MAGENTO_URL || 'http://magento2.demo-1.divante.pl/rest/', | ||
consumerKey: process.env.MAGENTO_CONSUMER_KEY || 'alva6h6hku9qxrpfe02c2jalopx7od1q', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@pkarw If you are inside this
else
it meanscat
is null, but you are trying to use props oncat
which throws an error.