Skip to content

Commit

Permalink
Add subscription variation support to WooPay button (#7884)
Browse files Browse the repository at this point in the history
Co-authored-by: Guilherme Pressutto <[email protected]>
  • Loading branch information
mdmoore and gpressutto5 authored Dec 18, 2023
1 parent dfd571b commit b891eee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions changelog/fix-7588-woopay-subscription-variation
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: fix
Comment: Edge case adding subscription_variation to WooPay button supported types


2 changes: 1 addition & 1 deletion includes/class-wc-payments-woopay-button-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ public function ajax_add_to_cart() {
WC()->cart->add_to_cart( $product->get_id(), $quantity, $variation_id, $attributes );
}

if ( in_array( $product_type, [ 'simple', 'subscription', 'bundle', 'mix-and-match' ], true ) ) {
if ( in_array( $product_type, [ 'simple', 'subscription', 'subscription_variation', 'bundle', 'mix-and-match' ], true ) ) {
WC()->cart->add_to_cart( $product->get_id(), $quantity );
}

Expand Down

0 comments on commit b891eee

Please sign in to comment.