Skip to content

Commit

Permalink
Fix Cannot modify header information warning due to PRESS4-508 code c…
Browse files Browse the repository at this point in the history
…hanges
  • Loading branch information
Arati Bhandare committed Apr 15, 2024
1 parent 97e309f commit 9c6fede
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions includes/ECommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,10 @@ public static function add_filters( $tags, $function_to_add, $priority = 10, $ac
*/
public static function set_wpnav_collapse_setting( $brandNameValue ) {

$expiration_time = time() + ( 10 * 365 * 24 * 60 * 60 );
setcookie( 'nfdbrandname', $brandNameValue, $expiration_time, '/' );

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
2 changes: 1 addition & 1 deletion includes/wpnavbar.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

document.addEventListener('DOMContentLoaded', function() {

let brandCookie = "?page="+getCookie('nfdbrandname');
let brandCookie = "?page="+navBarParams.nfdbrandname;
let urlSearchString = window.location.search;


Expand Down

0 comments on commit 9c6fede

Please sign in to comment.