|
@@ 713-718 (lines=6) @@
|
| 710 |
|
if ( 'variable' === ( WC_Stripe_Helper::is_pre_30() ? $product->product_type : $product->get_type() ) && isset( $_POST['attributes'] ) ) { |
| 711 |
|
$attributes = array_map( 'wc_clean', $_POST['attributes'] ); |
| 712 |
|
|
| 713 |
|
if ( WC_Stripe_Helper::is_pre_30() ) { |
| 714 |
|
$variation_id = $product->get_matching_variation( $attributes ); |
| 715 |
|
} else { |
| 716 |
|
$data_store = WC_Data_Store::load( 'product' ); |
| 717 |
|
$variation_id = $data_store->find_matching_product_variation( $product, $attributes ); |
| 718 |
|
} |
| 719 |
|
|
| 720 |
|
if ( ! empty( $variation_id ) ) { |
| 721 |
|
$product = wc_get_product( $variation_id ); |
|
@@ 803-808 (lines=6) @@
|
| 800 |
|
if ( 'variable' === ( WC_Stripe_Helper::is_pre_30() ? $product->product_type : $product->get_type() ) && isset( $_POST['attributes'] ) ) { |
| 801 |
|
$attributes = array_map( 'wc_clean', $_POST['attributes'] ); |
| 802 |
|
|
| 803 |
|
if ( WC_Stripe_Helper::is_pre_30() ) { |
| 804 |
|
$variation_id = $product->get_matching_variation( $attributes ); |
| 805 |
|
} else { |
| 806 |
|
$data_store = WC_Data_Store::load( 'product' ); |
| 807 |
|
$variation_id = $data_store->find_matching_product_variation( $product, $attributes ); |
| 808 |
|
} |
| 809 |
|
|
| 810 |
|
WC()->cart->add_to_cart( $product->get_id(), $qty, $variation_id, $attributes ); |
| 811 |
|
} |