Skip to content

Commit

Permalink
Switch plan type to Paid by default, allow price to be optional (#2795)
Browse files Browse the repository at this point in the history
  • Loading branch information
brianhogg authored Nov 4, 2024
1 parent 6dcc98f commit eba1964
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changelogs/fix_filter-on-access-plan-price-required.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
significance: patch
type: changed
links:
- "#2794"
entry: Switches new access plans to Paid by default in the new access plan UI.
14 changes: 12 additions & 2 deletions includes/admin/views/access-plans/access-plan.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@
</span>
</label>
<select id="_llms_plans[<?php echo esc_attr( $order ); ?>][is_free]" data-controller-id="llms-is-free" name="_llms_plans[<?php echo esc_attr( $order ); ?>][is_free]"<?php echo ( $plan ) ? '' : ' disabled="disabled"'; ?>>
<option value="yes"<?php selected( 'yes', $plan ? $plan->get( 'is_free' ) : '' ); ?>><?php esc_html_e( 'Free', 'lifterlms' ); ?></option>
<option value="no"<?php selected( 'no', $plan ? $plan->get( 'is_free' ) : true ); ?>><?php esc_html_e( 'Paid', 'lifterlms' ); ?></option>
<option value="yes"<?php selected( 'yes', $plan ? $plan->get( 'is_free' ) : '' ); ?>><?php esc_html_e( 'Free', 'lifterlms' ); ?></option>
</select>

</div>
Expand All @@ -233,7 +233,17 @@
<i class="fa fa-question-circle"></i>
</span>
</label>
<input id="_llms_plans[<?php echo esc_attr( $order ); ?>][price]" class="llms-plan-price" name="_llms_plans[<?php echo esc_attr( $order ); ?>][price]" min="<?php echo esc_attr( $price_step ); ?>" placeholder="<?php echo esc_attr( strip_tags( llms_price( 1000 ) ) ); ?>" required="required" step="<?php echo esc_attr( $price_step ); ?>" type="number"<?php echo ( $plan ? ' value="' . esc_attr( $plan->get( 'price' ) ) . '"' : ' disabled="disabled"' ); ?>>
<input
id="_llms_plans[<?php echo esc_attr( $order ); ?>][price]"
class="llms-plan-price" name="_llms_plans[<?php echo esc_attr( $order ); ?>][price]"
placeholder="<?php echo esc_attr( strip_tags( llms_price( 1000 ) ) ); ?>"
<?php if ( apply_filters( 'llms_access_plan_price_required', true, $plan ) ) : ?>
min="<?php echo esc_attr( $price_step ); ?>"
required="required"
<?php endif; ?>
step="<?php echo esc_attr( $price_step ); ?>"
type="number"<?php echo ( $plan ? ' value="' . esc_attr( $plan->get( 'price' ) ) . '"' : ' disabled="disabled"' ); ?>
>
</div>

<div class="llms-metabox-field d-1of4">
Expand Down

0 comments on commit eba1964

Please sign in to comment.