PluginProbe
Subscriptions for WooCommerce with Stripe Recurring Payments / 2.0.0
Subscriptions for WooCommerce with Stripe Recurring Payments v2.0.0
2.0.0 1.11.2 1.11.1 1.11.0 1.10.9 1.10.8 1.10.7 1.10.6 1.10.5 1.10.4 1.10.3 1.10.2 1.10.1 1.10.0 1.9.6 1.9.5 trunk 1.3.0 1.3.1 1.3.2 1.4.0 1.4.1 1.4.2 1.5.0 1.5.1 All 61 releases
← All changes | includes/Frontend/Checkout.php +9 -2 1.11.22.0.0 View file →
@@ -67,10 +67,17 @@
67 67 $order_items = $order->get_items();
68 68 foreach ( $order_items as $order_item ) {
69 69 $product = Subscription::get_subs_product( $order_item['product_id'] );
70 70
71 - if ( $product->is_type( 'simple' ) && ! subscrpt_pro_activated() ) {
72 - if ( $product->is_enabled() ) {
71 + // Plan items are created by Frontend\PlanCheckout on `subscrpt_product_checkout`
72 + // below (resolution order: tied plan first, else classic meta). Skipping
73 + // them here keeps the classic path from creating a second subscription.
74 + if ( $product->is_type( 'simple' ) && ! subscrpt_pro_activated() && ! $order_item->get_meta( '_subscrpt_plan_id' ) ) {
75 + // A plan product bought as One-Time carries no plan id — it is not a
76 + // subscription, so never record one for it.
77 + $is_one_time = function_exists( 'subscrpt_product_has_plan' ) && subscrpt_product_has_plan( $product->get_id() );
78 +
79 + if ( $product->is_enabled() && ! $is_one_time ) {
73 80 $is_renew = isset( $order_item['renew_subscrpt'] );
74 81
75 82 $timing_option = $product->get_timing_option();
76 83 $trial = $product->get_trial();