| @@ -10,10 +10,8 @@ | ||
| 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; | |
| 16 | 14 | use SpringDevs\Subscription\Illuminate\Subscription\Subscription; |
| 17 | 15 | use SpringDevs\Subscription\Utils\Product; |
| 18 | 16 | |
| 19 | 17 | /** |
| @@ -101,9 +99,9 @@ | ||
| 101 | 99 | * @return bool |
| 102 | 100 | */ |
| 103 | 101 | function subscrpt_product_has_plan( $product_id, $variation_id = 0 ): bool { |
| 104 | 102 | return ! empty( |
| 105 | - PlanRepository::resolve_for_product( $product_id, $variation_id ) | |
| 103 | + \SpringDevs\Subscription\Illuminate\Plans\PlanRepository::resolve_for_product( $product_id, $variation_id ) | |
| 106 | 104 | ); |
| 107 | 105 | } |
| 108 | 106 | |
| 109 | 107 | /** |
| @@ -556,24 +554,24 @@ | ||
| 556 | 554 | * @return string Plan label, or '' when the subscription has no plan. |
| 557 | 555 | */ |
| 558 | 556 | function subscrpt_get_subscription_plan_label( $subscription_id ) { |
| 559 | 557 | $plan_id = (int) get_post_meta( $subscription_id, '_subscrpt_plan_id', true ); |
| 560 | - if ( ! $plan_id || ! class_exists( PlanRepository::class ) ) { | |
| 558 | + if ( ! $plan_id || ! class_exists( '\SpringDevs\Subscription\Illuminate\Plans\PlanRepository' ) ) { | |
| 561 | 559 | return ''; |
| 562 | 560 | } |
| 563 | 561 | |
| 564 | - $plan = PlanRepository::get_plan( $plan_id ); | |
| 562 | + $plan = \SpringDevs\Subscription\Illuminate\Plans\PlanRepository::get_plan( $plan_id ); | |
| 565 | 563 | if ( ! $plan ) { |
| 566 | 564 | return ''; |
| 567 | 565 | } |
| 568 | 566 | |
| 569 | - $term_title = isset( $plan['title'] ) ? trim( Multilingual::translate_string( $plan['title'], Multilingual::plan_string_name( $plan_id ) ) ) : ''; | |
| 567 | + $term_title = isset( $plan['title'] ) ? trim( (string) $plan['title'] ) : ''; | |
| 570 | 568 | $group_title = ''; |
| 571 | 569 | $group_id = (int) ( $plan['plan_group_id'] ?? 0 ); |
| 572 | 570 | if ( $group_id ) { |
| 573 | - $group = PlanRepository::get_group( $group_id ); | |
| 571 | + $group = \SpringDevs\Subscription\Illuminate\Plans\PlanRepository::get_group( $group_id ); | |
| 574 | 572 | if ( $group && isset( $group['title'] ) ) { |
| 575 | - $group_title = trim( Multilingual::translate_string( $group['title'], Multilingual::group_string_name( $group_id ) ) ); | |
| 573 | + $group_title = trim( (string) $group['title'] ); | |
| 576 | 574 | } |
| 577 | 575 | } |
| 578 | 576 | |
| 579 | 577 | $parts = array_filter( array( $group_title, $term_title ) ); |