Get installed plugins from new plugin settings object. (https://github.com/woocommerce/woocommerce-admin/pull/4357)
This commit is contained in:
parent
4beb28ce20
commit
3e48eba385
|
@ -48,9 +48,7 @@ export function getProductIdsForCart(
|
||||||
profileItems,
|
profileItems,
|
||||||
includeInstalledItems = false
|
includeInstalledItems = false
|
||||||
) {
|
) {
|
||||||
const productIds = [];
|
|
||||||
const onboarding = getSetting( 'onboarding', {} );
|
const onboarding = getSetting( 'onboarding', {} );
|
||||||
const productTypes = profileItems.product_types || [];
|
|
||||||
|
|
||||||
// The population of onboarding.productTypes only happens if the task list should be shown
|
// The population of onboarding.productTypes only happens if the task list should be shown
|
||||||
// so bail early if it isn't present.
|
// so bail early if it isn't present.
|
||||||
|
@ -58,12 +56,16 @@ export function getProductIdsForCart(
|
||||||
return productIds;
|
return productIds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const productIds = [];
|
||||||
|
const plugins = getSetting( 'plugins', {} );
|
||||||
|
const productTypes = profileItems.product_types || [];
|
||||||
|
|
||||||
productTypes.forEach( ( productType ) => {
|
productTypes.forEach( ( productType ) => {
|
||||||
if (
|
if (
|
||||||
onboarding.productTypes[ productType ] &&
|
onboarding.productTypes[ productType ] &&
|
||||||
onboarding.productTypes[ productType ].product &&
|
onboarding.productTypes[ productType ].product &&
|
||||||
( includeInstalledItems ||
|
( includeInstalledItems ||
|
||||||
! onboarding.installedPlugins.includes(
|
! plugins.installedPlugins.includes(
|
||||||
onboarding.productTypes[ productType ].slug
|
onboarding.productTypes[ productType ].slug
|
||||||
) )
|
) )
|
||||||
) {
|
) {
|
||||||
|
|
Loading…
Reference in New Issue