Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

feat(default-theme): force review step for logged in users on checkout #523

Merged
merged 1 commit into from
Mar 19, 2020
Merged
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
7 changes: 7 additions & 0 deletions packages/default-theme/pages/checkout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ import PersonalDetails from '@shopware-pwa/default-theme/components/checkout/Per
import ReviewOrder from '@shopware-pwa/default-theme/components/checkout/ReviewOrder'
import Shipping from '@shopware-pwa/default-theme/components/checkout/Shipping'
import checkoutMiddleware from "@shopware-pwa/default-theme/middleware/checkout"
import { useUser } from '@shopware-pwa/composables'

export default {
name: 'Checkout',
Expand Down Expand Up @@ -225,6 +226,12 @@ export default {
]
}
},
asyncData: async (context) => {
const { isLoggedIn } = useUser();
// set current step to 3 (checkout's review) for logged in users, leave the first step otherwise
// TODO: create the global checkout's step map in format: 'review => 3, personalDetails => 0, etc'.
return { currentStep: isLoggedIn && isLoggedIn.value && 3 || 0 }
},
methods: {
updateStep(next) {
// prevent to move next by SfStep header
Expand Down