Skip to content

Commit

Permalink
Update brand data
Browse files Browse the repository at this point in the history
  • Loading branch information
arunshenoy99 committed Sep 18, 2023
1 parent f0c49fd commit 7a84bfb
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 75 deletions.
81 changes: 10 additions & 71 deletions includes/Data/Brands.php
Original file line number Diff line number Diff line change
Expand Up @@ -285,86 +285,21 @@ public static function get_brands() {
),
),
),
'hostgator-us' => array(
'brand' => 'hostgator',
'name' => 'HostGator',
'url' => 'https://www.hostgator.com',
'knowledgeBaseUrl' => 'https://www.hostgator.com/help',
'helpUrl' => 'https://www.hostgator.com/help',
'blogUrl' => 'https://www.hostgator.com/blog/',
'facebookUrl' => 'https://www.facebook.com/HostGator',
'twitterName' => '@hostgator',
'twitterUrl' => 'https://twitter.com/hostgator',
'youtubeUrl' => 'https://www.youtube.com/c/hostgatorUS',
'linkedinUrl' => 'https://www.linkedin.com/company/hostgator-com',
'accountUrl' => 'https://portal.hostgator.com/login',
'domainsUrl' => '',
'emailUrl' => 'https://www.crazydomains.com/contact/',
'pluginDashboardPage' => \admin_url( 'admin.php?page=hostgator' ),
'phoneNumbers' => array(
'support' => '8669642867',
),
'hireExpertsInfo' => array(
'defaultLink' => 'https://www.hostgator.com/services/web-design',
'fragment' => '',
'queryParameters' => array(
'utm_source' => 'wp-onboarding',
'utm_medium' => 'brand-plugin',
'utm_campaign' => 'wp-setup',
),
),
'expertsInfo' => array(
'defaultLink' => 'https://www.hostgator.com/help',
'queryParams' => array(
'utm_source' => 'wp-onboarding',
'utm_medium' => 'brand-plugin',
),
),
'fullServiceCreativeTeamInfo' => array(
'defaultLink' => 'https://www.hostgator.com/services/web-design',
'fragment' => '',
'queryParams' => array(
'utm_source' => 'wp-onboarding',
'utm_medium' => 'brand-plugin',
),
),
'techSupportInfo' => array(
'defaultLink' => 'https://www.hostgator.com/contact',
'queryParams' => array(
'utm_source' => 'wp-onboarding',
'utm_medium' => 'brand-plugin',
),
),
'config' => array(
'enabled_flows' => array(
'ecommerce' => true,
'wp-setup' => true,
),
'wonder_blocks' => true,
'views' => array(
'sidebar' => array(
'illustration' => array(
'shown' => false,
),
),
),
),
),
'hostgator-br' => array(
'brand' => 'hostgator',
'brand' => 'hostgator-br',
'name' => 'HostGator',
'url' => 'https://www.hostgator.com.br',
'knowledgeBaseUrl' => 'https://suporte.hostgator.com.br/hc/pt-br',
'helpUrl' => 'https://suporte.hostgator.com.br/hc/pt-br',
'helpUrl' => 'https://cliente.hostgator.com.br/suporte',
'blogUrl' => 'https://www.hostgator.com.br/blog/',
'facebookUrl' => 'https://www.facebook.com/HostgatorBrasil/',
'twitterName' => '@hostgatorbrasil',
'twitterUrl' => 'https://twitter.com/hostgatorbrasil',
'youtubeUrl' => 'https://www.youtube.com/c/HostGatorBrasil',
'linkedinUrl' => 'https://www.linkedin.com/company/hostgator-latam/',
'accountUrl' => 'https://financeiro.hostgator.com.br/',
'domainsUrl' => '',
'emailUrl' => 'https://cliente.hostgator.com.br/suporte',
'domainsUrl' => 'https://cliente.hostgator.com.br/dominios',
'emailUrl' => 'https://cliente.hostgator.com.br/emails-list',
'pluginDashboardPage' => \admin_url( 'admin.php?page=hostgator' ),
'phoneNumbers' => array(
'support' => '',
Expand Down Expand Up @@ -422,7 +357,7 @@ public static function get_brands() {
* Sets the hosting brand for which Onboarding is active.
*
* @param object $container The brand plugin container.
* @return void
* @return string
*/
public static function set_current_brand( $container ) {
if ( ! defined( 'NFD_ONBOARDING_PLUGIN_BRAND' ) ) {
Expand All @@ -436,7 +371,11 @@ public static function set_current_brand( $container ) {
$brand = "hostgator-{$region}";
}

define( 'NFD_ONBOARDING_PLUGIN_BRAND', sanitize_title_with_dashes( str_replace( '_', '-', $brand ) ) );
$brand = sanitize_title_with_dashes( str_replace( '_', '-', $brand ) );

define( 'NFD_ONBOARDING_PLUGIN_BRAND', $brand );

return $brand;
}
}
}
26 changes: 23 additions & 3 deletions includes/ModuleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ public static function init() {
public static function module_switcher() {
$module_name = 'onboarding';
// Set brand context for the module.
Brands::set_current_brand( container() );
$current_brand = Brands::set_current_brand( container() );

$enable_onboarding = self::verify_onboarding_criteria();
$enable_onboarding = self::verify_onboarding_criteria( $current_brand );

// Check if he is a Non-Ecommerce Customer and Disable Redirect and Module
if ( ! $enable_onboarding ) {
Expand All @@ -58,9 +58,10 @@ public static function module_switcher() {
/**
* Verify all the necessary criteria to enable Onboarding for the site.
*
* @param string $brand_name The kebab cased name of the brand.
* @return boolean
*/
public static function verify_onboarding_criteria() {
public static function verify_onboarding_criteria( $brand_name ) {
// Check if nfd_module_onboarding_activate query param was passed previously.
$activate_transient_name = Options::get_option_name( 'activate_param' );
if ( '1' === get_transient( $activate_transient_name ) ) {
Expand All @@ -75,6 +76,11 @@ public static function verify_onboarding_criteria() {
return true;
}

$eligible_brand = self::is_brand_eligible( $brand_name );
if ( ! $eligible_brand ) {
return false;
}

$customer_data = Data::customer_data();
$brand_enabled_flows = Flows::get_flows();
foreach ( $brand_enabled_flows as $flow => $enabled ) {
Expand All @@ -96,6 +102,20 @@ public static function verify_onboarding_criteria() {
return false;
}

/**
* Checks if a particular brand name is eligible for Onboarding.
*
* @param string $brand_name The kebab cased name of the brand.
* @return boolean
*/
public static function is_brand_eligible( $brand_name ) {
if ( false !== strpos( $brand_name, 'hostgator' ) && 'hostgator-br' !== $brand_name ) {
return false;
}

return true;
}

/**
* Determine if the install is a new commerce signup
*
Expand Down
2 changes: 1 addition & 1 deletion src/OnboardingSPA/styles/_branding.scss
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ body {
--nfd-onboarding-sidebar-learn-more-what-next-illustration: url(../../Brands/bluehost/learn-more-what-next.svg);
}

&.nfd-brand-hostgator {
&.nfd-brand-hostgator-br {
--wp-admin-theme-color: #2e93ee;
--wp-admin-theme-color--rgb: 46, 147, 238;
--wp-admin-theme-color-darker-10: #1485ec;
Expand Down

0 comments on commit 7a84bfb

Please sign in to comment.