Skip to content

Commit

Permalink
Merge pull request #290 from newfold-labs/update/region-case-insensitive
Browse files Browse the repository at this point in the history
Update/region case insensitive
  • Loading branch information
circlecube authored Oct 26, 2023
2 parents 82c8fcd + c1f568d commit e5df212
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function() {
'id' => 'hostgator',
'file' => HOSTGATOR_PLUGIN_FILE,
'brand' => get_option( 'mm_brand', 'hostgator' ),
'region' => get_option( 'hg_region', 'US' ),
'region' => strtoupper( get_option( 'hg_region', 'US' ) ),
'install_date' => get_option( 'hg_plugin_install_date', false ),
)
);
Expand All @@ -50,7 +50,7 @@ function() {
if ( get_option( 'mm_brand', false ) && get_option( 'hg_region', false ) ) {
$nfd_module_container->set(
'marketplace_brand',
get_option( 'mm_brand', false ) . '_' . get_option( 'hg_region', false )
get_option( 'mm_brand', false ) . '_' . strtoupper( get_option( 'hg_region', false ) )
);
}

Expand Down
7 changes: 3 additions & 4 deletions src/app/util/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export const comingSoonAdminbarToggle = ( comingSoon ) => {
*/
export const getRegionValue = () => {
const brand = NewfoldRuntime.sdk.plugin.brand;
const region = NewfoldRuntime.sdk.plugin.region;
const region = NewfoldRuntime.sdk.plugin.region.toUpperCase();

// bail if not hostgator-latam brand
if ( brand !== 'hostgator-latam' ){
Expand All @@ -151,16 +151,15 @@ export const getRegionValue = () => {
// qualify region setting and return region code
switch ( region ) {
case 'BR':
return region;
break;
case 'MX':
case 'CO':
case 'CL':
return region;
break;
case 'US':
case false:
default:
return '';
return 'default';
}
};

Expand Down

0 comments on commit e5df212

Please sign in to comment.