Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Fixes - Solutions #360

Merged
merged 2 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 34 additions & 2 deletions includes/Data/Plugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,47 @@ final class Plugins {
* @var array<string, array<string, string>> $free_plugins
*/
public static $premium_plugins = array(
// TODO: More plugins to be added here as once their data is available

//Search Engine Optimization
'wp-seo' => array(
'url' => 'wp-admin/admin.php?page=wpseo_dashboard#top#first-time-configuration',
'file' => 'wordpress-seo/wp-seo.php'
),
//Offer Content Courses
'sensei-lms' => array(
'url' => 'wp-admin/admin.php?page=wpseo_dashboard#top#first-time-configuration',
'url' => 'wp-admin/post-new.php?post_type=course',
'file' => 'sensei-lms/sensei-lms.php'
),
//Add An Affiliate Program
'yith-woocommerce-affiliates' => array(
'url' => 'wp-admin/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(
'url' => 'wp-admin/edit.php?post_type=yith_booking&yith-plugin-fw-panel-skip-redirect=1',
'file' => 'yith-woocommerce-booking/init.php'
),
//Setup A Loyalty Program
'yith-woocommerce-points-and-rewards' => array(
'url' => 'wp-admin/admin.php?page=yith_woocommerce_points_and_rewards&tab=points&sub_tab=points-standard',
'file' => 'yith-woocommerce-points-and-rewards/init.php'
),
//Setup WishList
'yith-woocommerce-wishlist' => array(
'url' => 'wp-admin/admin.php?page=yith_wcwl_panel&tab=settings&sub_tab=settings-general',
'file' => 'yith-woocommerce-wishlist/init.php'
),
//Enable Product Reviews
'yith-woocommerce-advanced-reviews' => array(
'url' => 'wp-admin/admin.php?page=yith_ywar_panel',
'file' => 'yith-woocommerce-advanced-reviews/init.php'
),
//Create a Sales Campaign
'yith-woocommerce-dynamic-pricing-and-discounts' => array(
'url' => 'wp-admin/edit.php?post_type=ywdpd_discount&yith-plugin-fw-panel-skip-redirect=1',
'file' => 'yith-woocommerce-dynamic-pricing-and-discounts/init.php'
)
);

/**
Expand Down
2 changes: 2 additions & 0 deletions src/components/NoExistingPlan.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import { Section } from "./Section";
export function NoExistingPlan(props){
const { availableSolutions } = props;

availableSolutions?.sort((a, b) => a.priority - b.priority);

const HtmlContent = ({ htmlString }) => {
return (
<div
Expand Down
11 changes: 7 additions & 4 deletions src/components/WPSolutionsBanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function WPSolutionsBanner() {
"nfd_slug_wonder_cart",
() =>
PluginsSdk.queries
.status("nfd_slug_wonder_cart", "sensei-lms", "wp-seo")
.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")
.then(res => {
setPluginActiveStatusArray(res?.details)
}),
Expand Down Expand Up @@ -100,9 +100,9 @@ export function WPSolutionsBanner() {
{ __(`${details['description']}`,"wp-module-ecommerce") }
</p>
{
details.slug !== "" ?
details.plsSlug !== "" ?
Object.entries(pluginActiveStatusArray).map(([slug, { status, url }]) => (
details.slug === slug ?
details.plsSlug === slug ?
status === "active" ?
<Button className="nfd-button nfd-button--primary nfd-mt-9 nfd-mt-auto nfd-self-start" as="a" href={url}>
{ __(`${details['buttonText']}`,"wp-module-ecommerce") }
Expand All @@ -114,8 +114,11 @@ export function WPSolutionsBanner() {
className="nfd-button nfd-button--primary nfd-mt-9 nfd-mt-auto nfd-self-start"
as="button"
data-nfd-installer-plugin-slug={slug}
data-nfd-installer-plugin-provider={details.providerName}
data-nfd-installer-plugin-provider={details.plsProviderName}
data-nfd-installer-plugin-activate={true}
data-nfd-installer-plugin-name={details.name}
data-nfd-installer-plugin-url={url}
data-nfd-installer-plugin-storage-key={details.storageKey}
isLoading={status==="installing"}
>
{ status==="installing" ? __("Installing","wp-module-ecommerce") : __("Install","wp-module-ecommerce") }
Expand Down
74 changes: 49 additions & 25 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,67 +45,83 @@ export const wonderCartPopularCampaignsList = [
}
];

//TODO: To add slug & providerName information for all plugins once it is available
//TODO: To add storageKey & plsProviderName information for all plugins once it is available
export const wpSolutionsPromotedPluginsList = [
{
"WP_SOLUTION_CREATOR": [
{
title: "WEBPAGE CREATION",
description: "Build webpages fast with tailored block patterns and page templates included in your hosting package.",
buttonText: "Add a Page to Your Site",
slug: "",
providerName: ""
name: " ",
plsSlug: " ",
storageKey: " ",
plsProviderName: " "
},
{
title: "SEARCH ENGINE OPTIMIZATION",
description: "Start increasing your search result rankings today.",
buttonText: "Improve Your Search Ranking",
slug: "wp-seo",
providerName: ""
name:"Yoast SEO",
plsSlug: "wp-seo",
storageKey: "",
plsProviderName: ""
},
{
title: "OFFER CONTENT COURSES",
description: "Create beautiful and engaging online courses, lessons, and quizzes.",
buttonText: "Create a Course",
slug: "sensei-lms",
providerName: ""
name: "",
plsSlug: "sensei-lms",
storageKey: "",
plsProviderName: ""
},
{
title: "ADD AN AFFILIATE PROGRAM",
description: "Grant your affiliates earnings each time someone purchases from their link.",
buttonText: "Create an Affiliate Program",
slug: "",
providerName: ""
name: "Affiliate Programs",
plsSlug: "yith-woocommerce-affiliates",
storageKey: "",
plsProviderName: "yith"
}
],
"WP_SOLUTION_SERVICE": [
{
title: "SETUP BOOKINGS",
description: "Manage the renting or booking of services and items that you offer your customers.",
buttonText: "Setup Bookings",
slug: "",
providerName: ""
name: "",
plsSlug: "yith-woocommerce-booking",
storageKey: "",
plsProviderName: "yith"
},
{
title: "WEBPAGE CREATION",
description: "Build webpages fast with tailored block patterns and page templates.",
buttonText: "Add a Page to Your Site",
slug: "",
providerName: ""
name: " ",
plsSlug: " ",
storageKey: " ",
plsProviderName: " "
},
{
title: "SEARCH ENGINE OPTIMIZATION",
description: "Start increasing your search result rankings today.",
buttonText: "Improve Your Search Ranking",
slug: "wp-seo",
providerName: ""
name: "Yoast SEO",
plsSlug: "wp-seo",
storageKey: "",
plsProviderName: ""
},
{
title: "SETUP A LOYALTY PROGRAM",
description: "Reward customer loyalty with an effective points program.",
buttonText: "Configure Points & Rewards",
slug: "",
providerName: ""
name: "Bookings & Appointments",
plsSlug: "yith-woocommerce-points-and-rewards",
storageKey: "",
plsProviderName: "yith"
},

],
Expand All @@ -114,29 +130,37 @@ export const wpSolutionsPromotedPluginsList = [
title: "SETUP WISHLISTS",
description: "Let customers add products to lists and share them with family and friends.",
buttonText: "Setup Wishilsts",
slug: "",
providerName: ""
name: "Wishlists",
plsSlug: "yith-woocommerce-wishlist",
storageKey: "",
plsProviderName: "yith"
},
{
title: "ENABLE PRODUCT REVIEWS",
description: "Get positive product reviews and use social proof to drive more sales.",
buttonText: "Enable Product Reviews",
slug: "",
providerName: ""
name: "Advanced Reviews",
plsSlug: "yith-woocommerce-advanced-reviews",
storageKey: "",
plsProviderName: "yith"
},
{
title: "CREATE A SALES CAMPAIGN",
description: "Create custom upsell, cross-sell and other promotional campaigns to generate more sales.",
buttonText: "Create a Campaign",
slug: "nfd_slug_wonder_cart",
providerName: ""
name: "SALES CAMPAIGN",
plsSlug: "yith-woocommerce-dynamic-pricing-and-discounts",
storageKey: "",
plsProviderName: "yith"
},
{
title: "SEARCH ENGINE OPTIMIZATION",
description: "Start increasing your search result rankings today.",
buttonText: "Improve Your Search Ranking",
slug: "wp-seo",
providerName: ""
name: "Yoast SEO",
plsSlug: "wp-seo",
storageKey: "",
plsProviderName: ""
},

],
Expand Down
Loading