| @@ -16,8 +16,9 @@ | ||
| 16 | 16 | */ |
| 17 | 17 | |
| 18 | 18 | namespace SpringDevs\Subscription\Admin\Product; |
| 19 | 19 | |
| 20 | +use SpringDevs\Subscription\Illuminate\Helper; | |
| 20 | 21 | use SpringDevs\Subscription\Illuminate\Plans\PlanRepository; |
| 21 | 22 | |
| 22 | 23 | /** |
| 23 | 24 | * Product-editor plan view. |
| @@ -658,8 +659,27 @@ | ||
| 658 | 659 | <?php endif; ?> |
| 659 | 660 | <?php endif; ?> |
| 660 | 661 | </div> |
| 661 | 662 | <?php endforeach; ?> |
| 663 | + </div> | |
| 664 | + <?php endif; ?> | |
| 665 | + | |
| 666 | + <?php if ( ! $product->is_type( 'variable' ) ) : ?> | |
| 667 | + <?php | |
| 668 | + // No name: the classic `subscrpt_user_cancel` select is what the product | |
| 669 | + // save reads. product-plans.js keeps the two in step, so there is one | |
| 670 | + // value on the form whichever view is showing. Variable products set it | |
| 671 | + // per variation instead. | |
| 672 | + ?> | |
| 673 | + <div class="wpsubs-table-card" style="padding:12px 14px;margin-top:18px;"> | |
| 674 | + <label class="wpsubs-settings-toggle-label" style="display:flex;align-items:center;gap:10px;cursor:pointer;"> | |
| 675 | + <input type="checkbox" class="wpsubs-toggle" data-subscrpt-plan-user-cancel <?php checked( Helper::can_user_cancel( $product->get_meta( '_subscrpt_user_cancel' ) ) ); ?> /> | |
| 676 | + <span class="wpsubs-toggle-ui" aria-hidden="true"></span> | |
| 677 | + <span style="display:flex;flex-direction:column;gap:2px;"> | |
| 678 | + <strong style="font-size:13px;color:var(--wpsubs-text);"><?php esc_html_e( 'Allow User Cancellation', 'subscription' ); ?></strong> | |
| 679 | + <span style="font-size:12px;color:var(--wpsubs-text-muted);"><?php esc_html_e( 'Allow subscribers to cancel their subscription manually from their account dashboard.', 'subscription' ); ?></span> | |
| 680 | + </span> | |
| 681 | + </label> | |
| 662 | 682 | </div> |
| 663 | 683 | <?php endif; ?> |
| 664 | 684 | |
| 665 | 685 | <?php |