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'
|
import { shopLocations, cartOpen, cartNotifications } from '$utils/stores/shop'
|
||||||
// Components
|
// Components
|
||||||
import Metas from '$components/Metas.svelte'
|
import Metas from '$components/Metas.svelte'
|
||||||
import PosterLayout from '$components/layouts/PosterLayout.svelte'
|
|
||||||
import SiteTitle from '$components/atoms/SiteTitle.svelte'
|
import SiteTitle from '$components/atoms/SiteTitle.svelte'
|
||||||
import Image from '$components/atoms/Image.svelte'
|
import Image from '$components/atoms/Image.svelte'
|
||||||
import ButtonCart from '$components/atoms/ButtonCart.svelte'
|
import ButtonCart from '$components/atoms/ButtonCart.svelte'
|
||||||
import Poster from '$components/molecules/Poster.svelte'
|
import Poster from '$components/molecules/Poster.svelte'
|
||||||
import NotificationCart from '$components/molecules/NotificationCart.svelte'
|
import NotificationCart from '$components/molecules/NotificationCart.svelte'
|
||||||
import EmailForm from '$components/molecules/EmailForm.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'
|
import Cart from '$components/organisms/Cart.svelte'
|
||||||
|
|
||||||
export let shop: any
|
export let shop: any
|
||||||
export let locations: any
|
export let locations: any
|
||||||
export let posters: any
|
export let posters: any
|
||||||
export let product: any
|
export let product: any
|
||||||
export let shopProduct: any
|
|
||||||
export let shopProducts: any
|
export let shopProducts: any
|
||||||
|
|
||||||
let introEl: HTMLElement
|
let introEl: HTMLElement
|
||||||
@@ -135,10 +133,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<PosterLayout
|
<slot />
|
||||||
product={product}
|
|
||||||
shopProduct={shopProduct}
|
|
||||||
/>
|
|
||||||
|
|
||||||
{#if posters}
|
{#if posters}
|
||||||
<section class="shop-page__posters grid">
|
<section class="shop-page__posters grid">
|
||||||
@@ -160,8 +155,6 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<slot />
|
|
||||||
|
|
||||||
|
|
||||||
<script context="module" lang="ts">
|
<script context="module" lang="ts">
|
||||||
import { fetchAPI } from '$utils/api'
|
import { fetchAPI } from '$utils/api'
|
||||||
@@ -259,6 +252,10 @@
|
|||||||
product: productAPI,
|
product: productAPI,
|
||||||
shopProducts,
|
shopProducts,
|
||||||
shopProduct,
|
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