hyyan / woo-poly-integration

Looking for maintainers! - Wordpress WooCommerce Polylang Integration
https://wordpress.org/plugins-wp/woo-poly-integration/
MIT License
183 stars 66 forks source link

jQuery Migrate: jQuery.parseJSON requires a valid JSON string #522

Closed webappvicio closed 3 years ago

webappvicio commented 3 years ago

woo-poly-integration/public/js/Cart.min.js jQuery.parseJSON requires a valid JSON string

Line 143 (Cart.js) var wc_fragments = $.parseJSON( sessionStorage.getItem( wc_cart_fragments_params.fragment_name ) )

How I can fix the code to avoid the deprecation warning?

jQuery Migrate Version 2.62, WooCommerce 4.8.0, WordPress 5.6, Polylang (free) Version 2.9.1

mrleemon commented 3 years ago

Try replacing that line with:

var wc_fragments = JSON.parse( sessionStorage.getItem( wc_cart_fragments_params.fragment_name ) );

mrleemon commented 3 years ago

@Jon007 You forgot to make the change in the Cart.min.js file, which is the one that is actually used in the plugin.