Skip to content

Commit bd5b52b

Browse files
committed
ECE: fix missing product ID when adding product with variations (#3880)
* Fix missing product ID when adding product with variations * Add changelog and readme entries
1 parent 3bd2f0c commit bd5b52b

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
*** Changelog ***
22

33
= 9.2.0 - xxxx-xx-xx =
4+
* Fix - Fix missing product_id parameter for the express checkout add-to-cart operation.
45
* Fix - Fix the quantity parameter for the express checkout add-to-cart API call.
56
* Dev - Replaces part of the StoreAPI call code for the cart endpoints to use the newly introduced filter.
67
* Fix - Clear cart first when using express checkout inside the product page.

client/entrypoints/express-checkout/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,13 @@ jQuery( function ( $ ) {
610610
qty: $( quantityInputSelector ).val(),
611611
};
612612

613+
// Check if product is a variable product.
614+
if ( $( '.single_variation_wrap' ).length ) {
615+
productId = $( '.single_variation_wrap' )
616+
.find( 'input[name="product_id"]' )
617+
.val();
618+
}
619+
613620
if ( $( '.wc-bookings-booking-form' ).length ) {
614621
productId = $( '.wc-booking-product-id' ).val();
615622
}

readme.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ If you get stuck, you can ask for help in the [Plugin Forum](https://wordpress.o
111111
== Changelog ==
112112

113113
= 9.2.0 - xxxx-xx-xx =
114+
* Fix - Fix missing product_id parameter for the express checkout add-to-cart operation.
114115
* Fix - Fix the quantity parameter for the express checkout add-to-cart API call.
115116
* Dev - Replaces part of the StoreAPI call code for the cart endpoints to use the newly introduced filter.
116117
* Fix - Clear cart first when using express checkout inside the product page.

0 commit comments

Comments
 (0)