PluginProbe
Subscriptions for WooCommerce with Stripe Recurring Payments / 2.4.0
Subscriptions for WooCommerce with Stripe Recurring Payments v2.4.0
2.4.0 2.3.0 2.2.0 2.1.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 All 65 releases
← All changes | includes/functions.php +8 -6 2.0.0 → 2.4.0 View file →
@@ -10,8 +10,10 @@
10 10 exit;
11 11 }
12 12
13 13 use Automattic\WooCommerce\Internal\DataStores\Orders\CustomOrdersTableController;
14 +use SpringDevs\Subscription\Illuminate\Multilingual;
15 +use SpringDevs\Subscription\Illuminate\Plans\PlanRepository;
14 16 use SpringDevs\Subscription\Illuminate\Subscription\Subscription;
15 17 use SpringDevs\Subscription\Utils\Product;
16 18
17 19 /**
@@ -99,9 +101,9 @@
99 101 * @return bool
100 102 */
101 103 function subscrpt_product_has_plan( $product_id, $variation_id = 0 ): bool {
102 104 return ! empty(
103 - \SpringDevs\Subscription\Illuminate\Plans\PlanRepository::resolve_for_product( $product_id, $variation_id )
105 + PlanRepository::resolve_for_product( $product_id, $variation_id )
104 106 );
105 107 }
106 108
107 109 /**
@@ -554,24 +556,24 @@
554 556 * @return string Plan label, or '' when the subscription has no plan.
555 557 */
556 558 function subscrpt_get_subscription_plan_label( $subscription_id ) {
557 559 $plan_id = (int) get_post_meta( $subscription_id, '_subscrpt_plan_id', true );
558 - if ( ! $plan_id || ! class_exists( '\SpringDevs\Subscription\Illuminate\Plans\PlanRepository' ) ) {
560 + if ( ! $plan_id || ! class_exists( PlanRepository::class ) ) {
559 561 return '';
560 562 }
561 563
562 - $plan = \SpringDevs\Subscription\Illuminate\Plans\PlanRepository::get_plan( $plan_id );
564 + $plan = PlanRepository::get_plan( $plan_id );
563 565 if ( ! $plan ) {
564 566 return '';
565 567 }
566 568
567 - $term_title = isset( $plan['title'] ) ? trim( (string) $plan['title'] ) : '';
569 + $term_title = isset( $plan['title'] ) ? trim( Multilingual::translate_string( $plan['title'], Multilingual::plan_string_name( $plan_id ) ) ) : '';
568 570 $group_title = '';
569 571 $group_id = (int) ( $plan['plan_group_id'] ?? 0 );
570 572 if ( $group_id ) {
571 - $group = \SpringDevs\Subscription\Illuminate\Plans\PlanRepository::get_group( $group_id );
573 + $group = PlanRepository::get_group( $group_id );
572 574 if ( $group && isset( $group['title'] ) ) {
573 - $group_title = trim( (string) $group['title'] );
575 + $group_title = trim( Multilingual::translate_string( $group['title'], Multilingual::group_string_name( $group_id ) ) );
574 576 }
575 577 }
576 578
577 579 $parts = array_filter( array( $group_title, $term_title ) );