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

PRESS0-1201 #296

Merged
merged 2 commits into from
May 3, 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
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
Loading