Skip to content

Commit

Permalink
Changes as per Micahs comment on PRESS0-2276 on 14th Oct
Browse files Browse the repository at this point in the history
  • Loading branch information
aratidgr8 committed Oct 15, 2024
1 parent 3607613 commit 2a3090e
Show file tree
Hide file tree
Showing 4 changed files with 139 additions and 59 deletions.
2 changes: 1 addition & 1 deletion build/index.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wp-api-fetch', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-element', 'wp-i18n', 'wp-url'), 'version' => '06ff3c08674be118f358');
<?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wp-api-fetch', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-element', 'wp-i18n', 'wp-url'), 'version' => '404a0a7b724d2f08f5e9');
16 changes: 8 additions & 8 deletions includes/Data/Plugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,42 +51,42 @@ final class Plugins {

//Search Engine Optimization
'wp-seo' => array(
'url' => 'wp-admin/admin.php?page=wpseo_dashboard#top#first-time-configuration',
'url' => 'admin.php?page=wpseo_dashboard#top#first-time-configuration',
'file' => 'wordpress-seo/wp-seo.php'
),
//Offer Content Courses
'sensei-lms' => array(
'url' => 'wp-admin/post-new.php?post_type=course',
'url' => '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',
'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(
'url' => 'wp-admin/edit.php?post_type=yith_booking&yith-plugin-fw-panel-skip-redirect=1',
'url' => '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',
'url' => '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',
'url' => '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',
'url' => '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',
'url' => 'edit.php?post_type=ywdpd_discount&yith-plugin-fw-panel-skip-redirect=1',
'file' => 'yith-woocommerce-dynamic-pricing-and-discounts/init.php'
)
);
Expand Down
103 changes: 73 additions & 30 deletions src/components/WPSolutionsBanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,39 +100,82 @@ export function WPSolutionsBanner() {
{ __(`${details['description']}`,"wp-module-ecommerce") }
</p>
{
//For type plugin
details.plsSlug !== "" ?
Object.entries(pluginActiveStatusArray).map(([slug, { status, url }]) => (
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") }
<RightArrow className="nfd-mt-2.5" />
</Button>
:
status === "need_to_install" || "installing" ?
<Button
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.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") }
<RightArrow className="nfd-mt-2.5" />
</Button> : null

Object.entries(pluginActiveStatusArray).map(([slug, { status, url }]) => (
details.plsSlug === slug ?
(
//installed & active
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") }
<RightArrow className="nfd-mt-2.5" />
</Button>
)
:
//installed but not active
status === "need_to_activate" ?
(
<Button className="nfd-button nfd-button--primary nfd-mt-9 nfd-mt-auto nfd-self-start" as="button" data-plugin={details.basename}>
{ __(`${details['buttonText']}`,"wp-module-ecommerce") }
<RightArrow className="nfd-mt-2.5" />
</Button>
)
:
//need to install
status === "need_to_install" ?
//premium
details.plsProviderName && details.plsSlug ?
(
<Button
className="nfd-button nfd-button--primary nfd-mt-9 nfd-mt-auto nfd-self-start"
as="button"
data-nfd-installer-plugin-activate={true}
data-nfd-installer-plugin-slug={slug}
data-nfd-installer-plugin-provider={details.plsProviderName}
data-nfd-installer-plugin-name={details.name}
data-nfd-installer-plugin-url={url}
data-nfd-installer-plugin-storage-key={details.storageKey}
isLoading={status==="installing"}
>
{ __(`${details['buttonText']}`,"wp-module-ecommerce") }
<RightArrow className="nfd-mt-2.5" />
</Button>
)
:
//free
details.download ?
(
<Button
className="nfd-button nfd-button--primary nfd-mt-9 nfd-mt-auto nfd-self-start"
as="button"
data-nfd-installer-plugin-activate={true}
data-nfd-installer-plugin-name={details.name}
data-nfd-installer-download-url={details.download}
data-nfd-installer-plugin-url={url}
data-nfd-installer-plugin-storage-key={details.storageKey}
isLoading={status==="installing"}
>
{ __(`${details['buttonText']}`,"wp-module-ecommerce") }
<RightArrow className="nfd-mt-2.5" />
</Button>
) : null
:
null
)
: null
))
:
null
))
:
<Button className="nfd-button nfd-button--primary nfd-mt-9 nfd-mt-auto nfd-self-start" as="button" disabled={true}>
{ __(`${details['buttonText']}`,"wp-module-ecommerce") }
<RightArrow className="nfd-mt-2.5" />
</Button>
//For type not plugin
(<Button className="nfd-button nfd-button--primary nfd-mt-9 nfd-mt-auto nfd-self-start" as="a" href={details.url+"89538934954"}>
{ __(`${details['buttonText']}`,"wp-module-ecommerce") }
<RightArrow className="nfd-mt-2.5" />
</Button>)

}

</div>)
})
}
Expand Down
Loading

0 comments on commit 2a3090e

Please sign in to comment.