|
@@ 735-740 (lines=6) @@
|
| 732 |
|
if ( 'variable' === ( WC_Stripe_Helper::is_pre_30() ? $product->product_type : $product->get_type() ) && isset( $_POST['attributes'] ) ) { |
| 733 |
|
$attributes = array_map( 'wc_clean', $_POST['attributes'] ); |
| 734 |
|
|
| 735 |
|
if ( WC_Stripe_Helper::is_pre_30() ) { |
| 736 |
|
$variation_id = $product->get_matching_variation( $attributes ); |
| 737 |
|
} else { |
| 738 |
|
$data_store = WC_Data_Store::load( 'product' ); |
| 739 |
|
$variation_id = $data_store->find_matching_product_variation( $product, $attributes ); |
| 740 |
|
} |
| 741 |
|
|
| 742 |
|
if ( ! empty( $variation_id ) ) { |
| 743 |
|
$product = wc_get_product( $variation_id ); |
|
@@ 825-830 (lines=6) @@
|
| 822 |
|
if ( 'variable' === ( WC_Stripe_Helper::is_pre_30() ? $product->product_type : $product->get_type() ) && isset( $_POST['attributes'] ) ) { |
| 823 |
|
$attributes = array_map( 'wc_clean', $_POST['attributes'] ); |
| 824 |
|
|
| 825 |
|
if ( WC_Stripe_Helper::is_pre_30() ) { |
| 826 |
|
$variation_id = $product->get_matching_variation( $attributes ); |
| 827 |
|
} else { |
| 828 |
|
$data_store = WC_Data_Store::load( 'product' ); |
| 829 |
|
$variation_id = $data_store->find_matching_product_variation( $product, $attributes ); |
| 830 |
|
} |
| 831 |
|
|
| 832 |
|
WC()->cart->add_to_cart( $product->get_id(), $qty, $variation_id, $attributes ); |
| 833 |
|
} |