diff --git a/build/index.asset.php b/build/index.asset.php index 2d57bff2..95cef001 100644 --- a/build/index.asset.php +++ b/build/index.asset.php @@ -1 +1 @@ - array('lodash', 'moment', 'react', 'react-dom', 'wp-api-fetch', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-element', 'wp-i18n', 'wp-url'), 'version' => '2e99252879dbc96cca15'); + array('lodash', 'moment', 'react', 'react-dom', 'wp-api-fetch', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-element', 'wp-i18n', 'wp-url'), 'version' => 'fdecf6eb6c16f87153bc'); diff --git a/includes/Data/Plugins.php b/includes/Data/Plugins.php index 38410034..83b71a56 100644 --- a/includes/Data/Plugins.php +++ b/includes/Data/Plugins.php @@ -60,29 +60,29 @@ final class Plugins { 'file' => 'sensei-lms/sensei-lms.php' ), //Add An Affiliate Program - 'yith-woocommerce-affiliates' => array( + 'yith-woocommerce-affiliates-premium' => array( 'url' => 'admin.php?page=yith_wcaf_panel&tab=settings&sub_tab=settings-general', 'file' => 'yith-woocommerce-affiliates-premium/init.php' ), //Setup Bookings - 'yith-woocommerce-booking' => array( + 'yith-woocommerce-booking-premium' => array( 'url' => 'edit.php?post_type=yith_booking&yith-plugin-fw-panel-skip-redirect=1', - 'file' => 'yith-woocommerce-booking/init.php' + 'file' => 'yith-woocommerce-booking-premium/init.php' ), //Setup A Loyalty Program - 'yith-woocommerce-points-and-rewards' => array( + 'yith-woocommerce-points-and-rewards-premium' => array( 'url' => 'admin.php?page=yith_woocommerce_points_and_rewards&tab=points&sub_tab=points-standard', - 'file' => 'yith-woocommerce-points-and-rewards/init.php' + 'file' => 'yith-woocommerce-points-and-rewards-premium/init.php' ), //Setup WishList - 'yith-woocommerce-wishlist' => array( + 'yith-woocommerce-wishlist-premium' => array( 'url' => 'admin.php?page=yith_wcwl_panel&tab=settings&sub_tab=settings-general', - 'file' => 'yith-woocommerce-wishlist/init.php' + 'file' => 'yith-woocommerce-wishlist-premium/init.php' ), //Enable Product Reviews - 'yith-woocommerce-advanced-reviews' => array( + 'yith-woocommerce-advanced-reviews-premium' => array( 'url' => 'admin.php?page=yith_ywar_panel', - 'file' => 'yith-woocommerce-advanced-reviews/init.php' + 'file' => 'yith-woocommerce-advanced-reviews-premium/init.php' ), //Create a Sales Campaign 'yith-woocommerce-dynamic-pricing-and-discounts' => array( diff --git a/src/components/WPSolutionsBanner.js b/src/components/WPSolutionsBanner.js index f0e3fc1a..a466e853 100644 --- a/src/components/WPSolutionsBanner.js +++ b/src/components/WPSolutionsBanner.js @@ -23,12 +23,13 @@ export function WPSolutionsBanner() { const [ availableSolutions, setAvailableSolutions] = useState([]); const [ pluginActiveStatusArray, setPluginActiveStatusArray] = useState([]); let currentSolution = []; + const hasSolution = NewfoldRuntime.hasCapability("hasSolution"); let premiumPluginStatus = useSWR( "nfd_slug_wonder_cart", () => PluginsSdk.queries - .status("nfd_slug_wonder_cart", "sensei-lms", "wp-seo", "yith-woocommerce-affiliates", "yith-woocommerce-booking", "yith-woocommerce-points-and-rewards", "yith-woocommerce-wishlist", "yith-woocommerce-advanced-reviews", "yith-woocommerce-dynamic-pricing-and-discounts") + .status("nfd_slug_wonder_cart", "sensei-lms", "wp-seo", "yith-woocommerce-affiliates-premium", "yith-woocommerce-booking-premium", "yith-woocommerce-points-and-rewards-premium", "yith-woocommerce-wishlist-premium", "yith-woocommerce-advanced-reviews-premium", "yith-woocommerce-dynamic-pricing-and-discounts") .then(res => { setPluginActiveStatusArray(res?.details) }), @@ -82,7 +83,8 @@ export function WPSolutionsBanner() { wpSolutionsPromotedPluginsList[0]['WP_SOLUTION_SERVICE'] : wpSolutionsPromotedPluginsList[0]['WP_SOLUTION_COMMERCE']; let solutionsCards = Object.values(currentSolution); return( - + hasSolution && + ( { solutionsCards?.map((details, index) => { - return (
+ return (

{ __(`${details['title']}`,"wp-module-ecommerce") }

@@ -109,7 +111,7 @@ export function WPSolutionsBanner() { //installed & active status === "active" ? ( - @@ -118,7 +120,7 @@ export function WPSolutionsBanner() { //installed but not active status === "need_to_activate" ? ( - @@ -127,17 +129,17 @@ export function WPSolutionsBanner() { //need to install status === "need_to_install" ? //premium - details.plsProviderName && details.plsSlug ? + details.plsProviderName && details.plsSlug && !details.download ? ( ) @@ -185,7 +187,7 @@ export function WPSolutionsBanner() { {__(`View all your plugins and tools`, "wp-module-ecommerce")} - + ) ) } diff --git a/src/constants.js b/src/constants.js index 2604d7f9..c9280487 100644 --- a/src/constants.js +++ b/src/constants.js @@ -45,7 +45,6 @@ export const wonderCartPopularCampaignsList = [ } ]; -//TODO: To add storageKey, plsProviderName, download, basename information for all plugins once it is available export const wpSolutionsPromotedPluginsList = [ { "WP_SOLUTION_CREATOR": [ @@ -54,8 +53,7 @@ export const wpSolutionsPromotedPluginsList = [ description: "Build webpages fast with tailored block patterns and page templates included in your hosting package.", buttonText: "Add a Page to Your Site", name: "", - plsSlug: "", - storageKey: "", + plsSlug: "", plsProviderName: "", download: null, basename: "", @@ -66,8 +64,7 @@ export const wpSolutionsPromotedPluginsList = [ description: "Start increasing your search result rankings today.", buttonText: "Improve Your Search Ranking", name:"WordPress SEO", - plsSlug: "wp-seo", - storageKey: "", + plsSlug: "wp-seo", plsProviderName: "yoast", download: "https://downloads.wordpress.org/plugin/wordpress-seo.latest-stable.zip", basename: "wordpress-seo/wp-seo.php", @@ -78,10 +75,9 @@ export const wpSolutionsPromotedPluginsList = [ description: "Create beautiful and engaging online courses, lessons, and quizzes.", buttonText: "Create a Course", name: "", - plsSlug: "sensei-lms", - storageKey: "", - plsProviderName: "", - download: null, + plsSlug: "sensei-lms", + plsProviderName: "automattic", + download: "https://downloads.wordpress.org/plugin/sensei-lms.latest-stable.zip", basename: "sensei-lms/sensei-lms.php", url: "post-new.php?post_type=course" @@ -91,11 +87,10 @@ export const wpSolutionsPromotedPluginsList = [ description: "Grant your affiliates earnings each time someone purchases from their link.", buttonText: "Create an Affiliate Program", name: "Affiliate Programs", - plsSlug: "yith-woocommerce-affiliates", - storageKey: "", + plsSlug: "yith-woocommerce-affiliates-premium", plsProviderName: "yith", download: null, - basename: "commerce-entitlement/commerce-entitlement.php", + basename: "yith-woocommerce-affiliates-premium/init.php", url: "admin.php?page=yith_wcaf_panel&tab=settings&sub_tab=settings-general" } ], @@ -105,11 +100,10 @@ export const wpSolutionsPromotedPluginsList = [ description: "Manage the renting or booking of services and items that you offer your customers.", buttonText: "Setup Bookings", name: "", - plsSlug: "yith-woocommerce-booking", - storageKey: "", + plsSlug: "yith-woocommerce-booking-premium", plsProviderName: "yith", download: null, - basename: "", + basename: "yith-woocommerce-booking-premium/init.php", url: "edit.php?post_type=yith_booking&yith-plugin-fw-panel-skip-redirect=1" }, { @@ -117,8 +111,7 @@ export const wpSolutionsPromotedPluginsList = [ description: "Build webpages fast with tailored block patterns and page templates.", buttonText: "Add a Page to Your Site", name: "", - plsSlug: "", - storageKey: "", + plsSlug: "", plsProviderName: "", download: null, basename: "", @@ -129,8 +122,7 @@ export const wpSolutionsPromotedPluginsList = [ description: "Start increasing your search result rankings today.", buttonText: "Improve Your Search Ranking", name: "Yoast SEO", - plsSlug: "wp-seo", - storageKey: "", + plsSlug: "wp-seo", plsProviderName: "yoast", download: "https://downloads.wordpress.org/plugin/wordpress-seo.latest-stable.zip", basename: "wordpress-seo/wp-seo.php", @@ -141,11 +133,10 @@ export const wpSolutionsPromotedPluginsList = [ description: "Reward customer loyalty with an effective points program.", buttonText: "Configure Points & Rewards", name: "Bookings & Appointments", - plsSlug: "yith-woocommerce-points-and-rewards", - storageKey: "", + plsSlug: "yith-woocommerce-points-and-rewards-premium", plsProviderName: "yith", download: null, - basename: "", + basename: "yith-woocommerce-points-and-rewards-premium/init.php", url:"admin.php?page=yith_woocommerce_points_and_rewards&tab=points&sub_tab=points-standard" }, @@ -156,11 +147,10 @@ export const wpSolutionsPromotedPluginsList = [ description: "Let customers add products to lists and share them with family and friends.", buttonText: "Setup Wishilsts", name: "Wishlists", - plsSlug: "yith-woocommerce-wishlist", - storageKey: "", + plsSlug: "yith-woocommerce-wishlist-premium", plsProviderName: "yith", download: null, - basename: "", + basename: "yith-woocommerce-wishlist-premium/init.php", url: "admin.php?page=yith_wcwl_panel&tab=settings&sub_tab=settings-general" }, { @@ -168,11 +158,10 @@ export const wpSolutionsPromotedPluginsList = [ description: "Get positive product reviews and use social proof to drive more sales.", buttonText: "Enable Product Reviews", name: "Advanced Reviews", - plsSlug: "yith-woocommerce-advanced-reviews", - storageKey: "", + plsSlug: "yith-woocommerce-advanced-reviews-premium", plsProviderName: "yith", download: null, - basename: "", + basename: "yith-woocommerce-advanced-reviews-premium/init.php", url: "admin.php?page=yith_ywar_panel" }, { @@ -180,11 +169,10 @@ export const wpSolutionsPromotedPluginsList = [ description: "Create custom upsell, cross-sell and other promotional campaigns to generate more sales.", buttonText: "Create a Campaign", name: "SALES CAMPAIGN", - plsSlug: "yith-woocommerce-dynamic-pricing-and-discounts", - storageKey: "", + plsSlug: "yith-woocommerce-dynamic-pricing-and-discounts", plsProviderName: "yith", download: null, - basename: "", + basename: "yith-woocommerce-dynamic-pricing-and-discounts/init.php", url: "edit.php?post_type=ywdpd_discount&yith-plugin-fw-panel-skip-redirect=1" }, { @@ -192,8 +180,7 @@ export const wpSolutionsPromotedPluginsList = [ description: "Start increasing your search result rankings today.", buttonText: "Improve Your Search Ranking", name: "Yoast SEO", - plsSlug: "wp-seo", - storageKey: "", + plsSlug: "wp-seo", plsProviderName: "yoast", download: "https://downloads.wordpress.org/plugin/wordpress-seo.latest-stable.zip", basename: "wordpress-seo/wp-seo.php", diff --git a/src/sdk/plugins.js b/src/sdk/plugins.js index ecc1dbe4..07274d7d 100644 --- a/src/sdk/plugins.js +++ b/src/sdk/plugins.js @@ -9,7 +9,7 @@ const Endpoints = { PLUGIN_INSTALL: NewfoldRuntime.createApiUrl("/newfold-installer/v1/plugins/install"), }; -const INSTALL_TOKEN = NewfoldRuntime.ecommerce.install_token; +const INSTALL_TOKEN = NewfoldRuntime.ecommerce?.install_token; export const PluginsSdk = { queries: {