Skip to content

Commit

Permalink
Merge pull request #296 from newfold-labs/PRESS0-1201
Browse files Browse the repository at this point in the history
PRESS0-1201
  • Loading branch information
ramyakrishnai authored May 3, 2024
2 parents 786a242 + 150837e commit 43d430e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 4 additions & 7 deletions includes/ECommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,7 @@ public function __construct( Container $container ) {
add_action( 'wp_login', array( $this, 'show_store_setup' ) );
add_action( 'auth_cookie_expired', array( $this, 'show_store_setup' ) );

$brandNameValue = $container->plugin()->brand;
$this->set_wpnav_collapse_setting( $brandNameValue );
add_action('admin_enqueue_scripts', array( $this, 'set_wpnav_collapse_setting'));

if ( ( $container->plugin()->id === 'bluehost' && ( $canAccessGlobalCTB || $hasYithExtended ) ) || ( $container->plugin()->id === 'hostgator' && $hasYithExtended ) ) {
add_filter( 'admin_menu', array( $this, 'custom_add_promotion_menu_item' ) );
Expand Down Expand Up @@ -198,12 +197,11 @@ public static function add_filters( $tags, $function_to_add, $priority = 10, $ac
}

/**
* Set the wpnav_collapse setting
*
* @param string $brandNameValue The brand name value
* Set the wpnav_collapse setting
*/
public static function set_wpnav_collapse_setting( $brandNameValue ) {
public function set_wpnav_collapse_setting() {

$brandNameValue = $this->container->plugin()->brand;
wp_enqueue_script( 'nfd_wpnavbar_setting', NFD_ECOMMERCE_PLUGIN_URL . 'vendor/newfold-labs/wp-module-ecommerce/includes/wpnavbar.js', array( 'jquery' ), '1.0', true );
$params = array( 'nfdbrandname' => $brandNameValue );
wp_localize_script( 'nfd_wpnavbar_setting', 'navBarParams', $params );
Expand Down Expand Up @@ -392,7 +390,6 @@ public function register_assets() {
NFD_ECOMMERCE_DIR . '/languages'
);
\wp_enqueue_script( 'nfd-ecommerce-dependency' );
\wp_enqueue_script( 'nfd_wpnavbar_setting' );
}
}

Expand Down

0 comments on commit 43d430e

Please sign in to comment.