wordpress-seo icon indicating copy to clipboard operation
wordpress-seo copied to clipboard

Cleanup woocommerceUpsell and add upsell links to store

Open vraja-pro opened this issue 1 year ago • 0 comments

What is the goal of this issue?

In a later issue, property of isWooSeoActive was added to metabox script data. That means woocommerceUpsell can be removed and calculated in the store.

What needs to be done to achieve the goal?

  • Go to packages/js/src/redux/selectors/isWooSEO.js and:
    • Add getIsWooActive, and export const getWoocommerceUpsellLink = get( window, "wpseoScriptData.metabox.woocommerceUpsellSchemaLink", "" );
    • Change getIsWooSeoUpsell to be calculated from the properties in the store: getIsProduct, getIsWooSeoActive, getIsWooActive
  • Change woocommerceUpsell to use getIsWooSeoUpsell from the store in:
    • packages/js/src/components/SchemaTab.js
    • packages/js/src/containers/SnippetEditor.js
  • Change woocommerceUpsellLink to use the store in
    • packages/js/src/components/SchemaTab.js

vraja-pro avatar Jan 22 '24 09:01 vraja-pro