| 1 |
<template> |
| 2 |
<div class="wpfnl-mm-setup-wizard-sidebar"> |
| 3 |
<Branding /> |
| 4 |
<Steps :currentStep="currentStep" :selectedGoal="selectedGoal" :storeCheckoutPhase="storeCheckoutPhase" /> |
| 5 |
<Help v-if="showSkipOption" @show-exit-modal="$emit('show-exit-modal')" /> |
| 6 |
</div> |
| 7 |
</template> |
| 8 |
|
| 9 |
<script> |
| 10 |
import Branding from './Branding.vue'; |
| 11 |
import Help from './Help.vue'; |
| 12 |
import Steps from './Steps.vue'; |
| 13 |
|
| 14 |
export default { |
| 15 |
name: 'Sidebar', |
| 16 |
components: { |
| 17 |
Branding, |
| 18 |
Help, |
| 19 |
Steps, |
| 20 |
}, |
| 21 |
props: { |
| 22 |
currentStep: { |
| 23 |
type: Number, |
| 24 |
default: 1 |
| 25 |
}, |
| 26 |
selectedGoal: { |
| 27 |
type: String, |
| 28 |
default: '' |
| 29 |
}, |
| 30 |
storeCheckoutPhase: { |
| 31 |
type: String, |
| 32 |
default: 'select' |
| 33 |
} |
| 34 |
}, |
| 35 |
computed: { |
| 36 |
isLastStep() { |
| 37 |
return this.currentStep === this.getMaxSteps(); |
| 38 |
}, |
| 39 |
showSkipOption() { |
| 40 |
// Hide on step 2 (Required Installation) — no skipping plugin setup |
| 41 |
if (this.currentStep === 2) return false; |
| 42 |
// Hide once step 3 is done (completed or skipped) |
| 43 |
if (this.currentStep === 3 && ['complete', 'skipped'].includes(this.storeCheckoutPhase)) return false; |
| 44 |
return true; |
| 45 |
} |
| 46 |
}, |
| 47 |
methods: { |
| 48 |
getMaxSteps() { |
| 49 |
// Dynamic step calculation based on goal |
| 50 |
if (this.selectedGoal === 'order-value') { |
| 51 |
return 6; // Welcome, Setup, ChooseGoal, ChooseTemplate, BuildFunnel, Complete |
| 52 |
} |
| 53 |
if (this.selectedGoal === 'improve-checkout') { |
| 54 |
return 3; // Welcome, Setup, StoreCheckout |
| 55 |
} |
| 56 |
if (this.selectedGoal === 'sales') { |
| 57 |
return 7; // Welcome, Setup, ChooseGoal, ProductSync, ChooseTemplate, GenerateFunnel, Complete |
| 58 |
} |
| 59 |
// Default before goal selection |
| 60 |
return 5; // Welcome, Setup, ChooseGoal, ChooseTemplate, Complete (initial display) |
| 61 |
} |
| 62 |
} |
| 63 |
} |
| 64 |
</script> |