Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [1.10.5] - unreleased

### Fixed
- disable product mutation when assigning product variant - @gibkigonzo (#3735)
- Render correct category links when multistore is active - @gibkigonzo (#3753)
- Disable product mutation when assigning product variant - @gibkigonzo (#3735)

## [1.10.4] - 18.10.2019

Expand Down
13 changes: 11 additions & 2 deletions core/modules/url/helpers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,17 @@ export function normalizeUrlPath (url: string): string {
return url
}

export function formatCategoryLink (category: { url_path: string, slug: string }): string {
return config.seo.useUrlDispatcher ? ('/' + category.url_path) : ('/c/' + category.slug)
export function formatCategoryLink (category: { url_path: string, slug: string }, storeCode: string = currentStoreView().storeCode): string {
storeCode ? storeCode += '/' : storeCode = '';

if (currentStoreView().appendStoreCode === false) {
storeCode = ''
}

if (category) {
return config.seo.useUrlDispatcher ? ('/' + storeCode + category.url_path) : ('/' + storeCode + 'c/' + category.slug)
}
return '/' + storeCode;
}

export function formatProductLink (
Expand Down
42 changes: 37 additions & 5 deletions src/themes/default/components/core/Breadcrumbs.vue
Original file line number Diff line number Diff line change
@@ -1,20 +1,52 @@
<template>
<div class="breadcrumbs h5 cl-gray">
<span v-for="link in routes" :key="link.route_link">
<router-link :to="localizedRoute(link.route_link)">
<span v-for="link in paths" :key="link.route_link">
<router-link :to="link.route_link">
{{ link.name | htmlDecode }}
</router-link> /
</span>
<span class="cl-mine-shaft">
{{ activeRoute | htmlDecode }}
{{ current | htmlDecode }}
</span>
</div>
</template>

<script>
import Breadcrumbs from '@vue-storefront/core/compatibility/components/Breadcrumbs'
import { localizedRoute, currentStoreView } from '@vue-storefront/core/lib/multistore'
import i18n from '@vue-storefront/i18n'

export default {
mixins: [Breadcrumbs]
computed: {
paths () {
const routes = this.routes ? this.routes : this.$store.state.breadcrumbs.routes

if (this.withHomepage) {
return [
{ name: i18n.t('Homepage'), route_link: localizedRoute('/', currentStoreView().storeCode) },
...routes
]
}

return routes
},
current () {
return this.activeRoute || this.$store.state.breadcrumbs.current
}
},
props: {
routes: {
type: Array,
required: false,
default: null
},
withHomepage: {
type: Boolean,
default: false
},
activeRoute: {
type: String,
default: ''
}
}
}
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<header class="thank-you-title bg-cl-secondary py35 pl20">
<div class="container">
<breadcrumbs
:with-homepage="true"
:routes="[{name: 'Homepage', route_link: '/'}]"
:active-route="this.$t('Order confirmation')"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<router-link
v-else
class="px25 py20 cl-accent no-underline col-xs"
:to="localizedRoute({ name: 'category', fullPath: category.url_path, params: { id: category.id, slug: category.slug }})"
:to="categoryLink(category)"
>
{{ category.name }}
</router-link>
Expand Down Expand Up @@ -140,6 +140,7 @@ import i18n from '@vue-storefront/i18n'
import SidebarMenu from '@vue-storefront/core/compatibility/components/blocks/SidebarMenu/SidebarMenu'
import SubBtn from 'theme/components/core/blocks/SidebarMenu/SubBtn'
import SubCategory from 'theme/components/core/blocks/SidebarMenu/SubCategory'
import { formatCategoryLink } from '@vue-storefront/core/modules/url/helpers'

export default {
components: {
Expand Down Expand Up @@ -218,6 +219,9 @@ export default {
this.$router.push({ name: 'my-account' })
})
}
},
categoryLink (category) {
return formatCategoryLink(category)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
>
<router-link
class="px25 py20 cl-accent no-underline col-xs"
:to="localizedRoute({ name: 'category', fullPath: parentPath, params: { id: id, slug: parentSlug }})"
:to="categoryLink({ url_path: parentPath, slug: parentSlug })"
data-testid="categoryLink"
>
{{ $t('View all') }}
Expand All @@ -35,7 +35,7 @@
<router-link
v-else
class="px25 py20 cl-accent no-underline col-xs"
:to="localizedRoute({ name: 'category', fullPath: link.url_path, params: { id: link.id, slug: link.slug }})"
:to="categoryLink(link)"
>
{{ link.name }}
</router-link>
Expand Down Expand Up @@ -84,6 +84,7 @@ import { mapState } from 'vuex'
import SubBtn from './SubBtn.vue'
import i18n from '@vue-storefront/i18n'
import config from 'config'
import { formatCategoryLink } from '@vue-storefront/core/modules/url/helpers'

export default {
name: 'SubCategory',
Expand Down Expand Up @@ -154,6 +155,9 @@ export default {
action1: { label: i18n.t('OK') }
})
}
},
categoryLink (category) {
return formatCategoryLink(category)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/themes/default/pages/Compare.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="compare">
<div class="bg-cl-secondary py35 pl20">
<div class="container">
<breadcrumbs :routes="[{name: 'Homepage', route_link: '/'}]" active-route="Compare" />
<breadcrumbs :with-homepage="true" :routes="[{name: 'Homepage', route_link: '/'}]" active-route="Compare" />
<h2>{{ title }}</h2>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/themes/default/pages/MyAccount.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<div class="bg-cl-secondary py35 pl20">
<div class="container">
<breadcrumbs
:with-homepage="true"
:routes="[{name: 'Homepage', route_link: '/'}]"
active-route="My Account"
/>
Expand Down
2 changes: 1 addition & 1 deletion src/themes/default/pages/Static.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div>
<div class="bg-cl-secondary py35 pl20">
<div class="container">
<breadcrumbs :routes="[{name: 'Homepage', route_link: '/'}]" :active-route="$props.title" />
<breadcrumbs :with-homepage="true" :routes="[{name: 'Homepage', route_link: '/'}]" :active-route="$props.title" />
<h2 class="fs-big">
{{ $props.title }}
</h2>
Expand Down
2 changes: 1 addition & 1 deletion src/themes/default/resource/banners/de_main-image.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"title": "Laufe den Lauf.",
"subtitle": "Eine Mode kann zum vorherrschenden Stil im Verhalten werden oder die neuesten Kreationen von Designern, Technologen, Ingenieuren und Designmanagern manifestieren.",
"image": "/assets/full_width_banner.jpg",
"link": "/c/frauen-20"
"link": "/women/frauen-20"
}
}
8 changes: 4 additions & 4 deletions src/themes/default/resource/banners/de_promoted_offers.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,29 @@
"title": "Büro lässig",
"subtitle": "Kollektion",
"image": "/assets/ban1.jpg",
"link": "/c/frauen-20"
"link": "/women/frauen-20"
}
],
"smallBanners": [
{
"title": "Sheinen",
"subtitle": "Zubehör",
"image": "/assets/ban2.jpg",
"link": "/c/herren-11"
"link": "/men/herren-11"
},
{
"title": "Der Frühling kommt",
"subtitle": "Hüte",
"image": "/assets/ban3.jpg",
"link": "/c/gerat-3"
"link": "/gear/gerat-3"
}
],
"productBanners": [
{
"title": "Der Frühling kommt",
"subtitle": "Hüte",
"image": "/assets/ban3.jpg",
"link": "/c/gerat-3"
"link": "/gear/gerat-3"
}
]
}
2 changes: 1 addition & 1 deletion src/themes/default/resource/banners/it_main-image.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"title": "Cammina la passeggiata.",
"subtitle": "Una moda può diventare lo stile prevalente nel comportamento o manifestare le ultime creazioni di designer, tecnologi, ingegneri e responsabili del design.",
"image": "/assets/full_width_banner.jpg",
"link": "/c/la-donne-20"
"link": "/women/la-donne-20"
}
}
8 changes: 4 additions & 4 deletions src/themes/default/resource/banners/it_promoted_offers.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,29 @@
"title": "Ufficio casual",
"subtitle": "Collezione",
"image": "/assets/ban1.jpg",
"link": "/c/la-donne-20"
"link": "/women/la-donne-20"
}
],
"smallBanners": [
{
"title": "Brilla",
"subtitle": "Accessori",
"image": "/assets/ban2.jpg",
"link": "/c/signori-11"
"link": "/men/signori-11"
},
{
"title": "La primavera sta arrivando",
"subtitle": "Cappelli",
"image": "/assets/ban3.jpg",
"link": "/c/equipaggiamento-3"
"link": "/gear/equipaggiamento-3"
}
],
"productBanners": [
{
"title": "La primavera sta arrivando",
"subtitle": "Cappelli",
"image": "/assets/ban3.jpg",
"link": "/c/equipaggiamento-3"
"link": "/gear/equipaggiamento-3"
}
]
}
2 changes: 1 addition & 1 deletion src/themes/default/resource/main-image.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"title": "Walk the walk.",
"subtitle": "A fashion can become the prevailing style in behaviour or manifest the newest creations of designers, technologists, engineers, and design managers.",
"image": "/assets/full_width_banner.jpg",
"link": "/c/women-20"
"link": "/women/women-20"
}
}
8 changes: 4 additions & 4 deletions src/themes/default/resource/promoted_offers.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,29 @@
"title": "Office casual",
"subtitle": "Collection",
"image": "/assets/ban1.jpg",
"link": "/c/women-20"
"link": "/women/women-20"
}
],
"smallBanners": [
{
"title": "Shine on",
"subtitle": "Accesories",
"image": "/assets/ban2.jpg",
"link": "/c/men-11"
"link": "/men/men-11"
},
{
"title": "Spring is coming",
"subtitle": "Hats",
"image": "/assets/ban3.jpg",
"link": "/c/gear-3"
"link": "/gear/gear-3"
}
],
"productBanners": [
{
"title": "Spring is coming",
"subtitle": "Hats",
"image": "/assets/ban3.jpg",
"link": "/c/gear-3"
"link": "/gear/gear-3"
}
]
}
6 changes: 3 additions & 3 deletions src/themes/default/resource/slider.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@
"subtitle": "New collection",
"button_text": "Shop now",
"image": "/assets/slide_01.jpg",
"link": "/c/women-20"
"link": "/women/women-20"
},
{
"title": "Luma Fitness",
"subtitle": "Collection",
"button_text": "Shop now",
"image": "/assets/slide_02.jpg",
"link": "/c/men-11"
"link": "/men/men-11"
},
{
"title": "Luma Fitness",
"subtitle": "What's new",
"button_text": "Shop now",
"image": "/assets/slide_03.jpg",
"link": "/c/training-9"
"link": "/training/training-9"
}
],
"total": "3"
Expand Down