Closed mrleemon closed 3 years ago
fair enough, looks like this fix will be in WooCommerce 5.. was changed a couple of days ago in: https://github.com/woocommerce/woocommerce/blob/master/assets/js/frontend/cart-fragments.js [this plugin file is copy of that with a few extra lines, I had diff-d to release version which didn't have these changes]
actually woocommerce 5.0.0-rc.2 still has .bind, maybe wait for their code to stabilise
I didn't know that, sorry. Yes, I see that WC 5.0 is supposed to fix all the jQuery deprecations.
According to this:
the bind()
in Cart.js
doesn't have to be replaced because wp.customize.selectiveRefresh
is not a jQuery object.
As of jQuery 3.0,
.bind()
has been deprecated. It was superseded by the.on()
method for attaching event handlers to a document. In/public/js/Cart.js
and/public/js/Cart.min.js
there is a reference to.bind()
that should be changed to.on()
in order to work with recent versions of WP:https://github.com/hyyan/woo-poly-integration/blob/383d3aa7ab16f9811344ed84ebb42539ec9e6b60/public/js/Cart.js#L225
wp.customize.selectiveRefresh.bind( 'partial-content-rendered', function() {
should be:
wp.customize.selectiveRefresh.on( 'partial-content-rendered', function() {