From 7050b92a39b9d6b8b002ee051bbb4d2ae60cf1cc Mon Sep 17 00:00:00 2001 From: Narek Zakarian Date: Fri, 28 Mar 2025 19:08:52 +0400 Subject: [PATCH] Hide the payment methods screen for personal user in branded-only mode --- .../js/Components/Screens/Onboarding/Steps/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/ppcp-settings/resources/js/Components/Screens/Onboarding/Steps/index.js b/modules/ppcp-settings/resources/js/Components/Screens/Onboarding/Steps/index.js index cf680db70..3eea08331 100644 --- a/modules/ppcp-settings/resources/js/Components/Screens/Onboarding/Steps/index.js +++ b/modules/ppcp-settings/resources/js/Components/Screens/Onboarding/Steps/index.js @@ -1,5 +1,6 @@ import { __ } from '@wordpress/i18n'; +import { CommonHooks, OnboardingHooks } from '../../../../data'; import StepWelcome from './StepWelcome'; import StepBusiness from './StepBusiness'; import StepProducts from './StepProducts'; @@ -56,11 +57,16 @@ const filterSteps = ( steps, conditions ) => { }; export const getSteps = ( flags ) => { + const { ownBrandOnly } = CommonHooks.useWooSettings(); + const { isCasualSeller } = OnboardingHooks.useBusiness(); + const steps = filterSteps( ALL_STEPS, [ // Casual selling: Unlock the "Personal Account" choice. ( step ) => flags.canUseCasualSelling || step.id !== 'business', // Skip payment methods screen. - ( step ) => ! flags.shouldSkipPaymentMethods || step.id !== 'methods', + ( step ) => + ! flags.shouldSkipPaymentMethods && + ! ( ownBrandOnly && isCasualSeller && step.id === 'methods' ), // personal user in branded-only mode. ] ); const totalStepsCount = steps.length;