Fix Cart issue by using PosterLayout on each shop page and not layout
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
<script lang="ts">
|
||||
import PosterLayout from '$components/layouts/PosterLayout.svelte'
|
||||
|
||||
export let product: any
|
||||
export let shopProduct: any
|
||||
</script>
|
||||
|
||||
<PosterLayout
|
||||
product={product}
|
||||
shopProduct={shopProduct}
|
||||
/>
|
||||
|
||||
<script context="module" lang="ts">
|
||||
export async function load ({ page, fetch, session, stuff }) {
|
||||
// Get content from stuff
|
||||
return {
|
||||
props: {
|
||||
product: stuff.product,
|
||||
shopProduct: stuff.shopProduct,
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -3,21 +3,19 @@
|
||||
import { shopLocations, cartOpen, cartNotifications } from '$utils/stores/shop'
|
||||
// Components
|
||||
import Metas from '$components/Metas.svelte'
|
||||
import PosterLayout from '$components/layouts/PosterLayout.svelte'
|
||||
import SiteTitle from '$components/atoms/SiteTitle.svelte'
|
||||
import Image from '$components/atoms/Image.svelte'
|
||||
import ButtonCart from '$components/atoms/ButtonCart.svelte'
|
||||
import Poster from '$components/molecules/Poster.svelte'
|
||||
import NotificationCart from '$components/molecules/NotificationCart.svelte'
|
||||
import EmailForm from '$components/molecules/EmailForm.svelte'
|
||||
import ShopLocationSwitcher from '$components/molecules/ShopLocationSwitcher.svelte';
|
||||
import ShopLocationSwitcher from '$components/molecules/ShopLocationSwitcher.svelte'
|
||||
import Cart from '$components/organisms/Cart.svelte'
|
||||
|
||||
export let shop: any
|
||||
export let locations: any
|
||||
export let posters: any
|
||||
export let product: any
|
||||
export let shopProduct: any
|
||||
export let shopProducts: any
|
||||
|
||||
let introEl: HTMLElement
|
||||
@@ -135,10 +133,7 @@
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<PosterLayout
|
||||
product={product}
|
||||
shopProduct={shopProduct}
|
||||
/>
|
||||
<slot />
|
||||
|
||||
{#if posters}
|
||||
<section class="shop-page__posters grid">
|
||||
@@ -160,8 +155,6 @@
|
||||
{/if}
|
||||
</main>
|
||||
|
||||
<slot />
|
||||
|
||||
|
||||
<script context="module" lang="ts">
|
||||
import { fetchAPI } from '$utils/api'
|
||||
@@ -259,6 +252,10 @@
|
||||
product: productAPI,
|
||||
shopProducts,
|
||||
shopProduct,
|
||||
},
|
||||
stuff: {
|
||||
product: productAPI,
|
||||
shopProduct,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
<script lang="ts">
|
||||
import PosterLayout from '$components/layouts/PosterLayout.svelte'
|
||||
|
||||
export let product: any
|
||||
export let shopProduct: any
|
||||
</script>
|
||||
|
||||
<PosterLayout
|
||||
product={product}
|
||||
shopProduct={shopProduct}
|
||||
/>
|
||||
|
||||
<script context="module" lang="ts">
|
||||
export async function load ({ page, fetch, session, stuff }) {
|
||||
// Get content from stuff
|
||||
return {
|
||||
props: {
|
||||
product: stuff.product,
|
||||
shopProduct: stuff.shopProduct,
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user