woocommerce / storefront

Official theme for WooCommerce
https://wordpress.org/themes/storefront/
959 stars 472 forks source link

Enqueue wc-cart-fragments on woocommerce pages #2113

Closed gigitux closed 11 months ago

gigitux commented 11 months ago

Fixes #2101

From WooCommerce Core 7.8, the wc-cart-fragments isn't enqueued by default anymore. This causes #2101. I followed the "Best practices for the use of the “cart fragments” API" post to fix the issue.

Also, given that the PR is small, I bumped the tested version to 8.0.

Screenshots

How to test the changes in this Pull Request:

  1. Add a product to the cart
  2. Go to the cart or the checkout page (shortcode or blocks versions)
  3. Hover over the Storefront header cart. Ensure no popup is displayed showing the cart info
  4. Update the cart (e.g., Add quantity, remove an item, add a coupon, etc.). Save changes if you are using the shortcode version of the cart and checkout pages. Ensure the Storefront header cart reflecting the current changes.

Changelog

Fix: Enqueue wc-cart-fragments script on woocommerce pages.