Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subscription delay wording is incorrect when setting an initial payment amount equal to subscription. #1544

Closed
kimwhite opened this issue Jan 5, 2021 · 3 comments

Comments

@kimwhite
Copy link
Contributor

kimwhite commented Jan 5, 2021

Describe the bug
When setting up a Level or Discount code and using Subscription Delay, if the amount is the same, the line "is $$$ now and then" is removed.

The price for membership is $4.00 now and then $5.00 per Year after your 200 day trial.

but if both are $5 we get this:

The price for membership is $5.00 per Year after your 200 day trial.
image
image

Expected behavior
Should show the initial price.

@michaelbeil
Copy link

I opened a similar issue in the Subscription Delays Add On repo: strangerstudios/pmpro-subscription-delays#25. Could add the above information there, so it can be addressed in the future.

@kimwhite
Copy link
Contributor Author

kimwhite commented Jan 6, 2021

My bad. Yes, this should be on plugin.

@dparker1005
Copy link
Member

This is the expected behavior of PMPro. If the initial payment and billing amount match, then they will not be separated in the level cost.

For reference, here is the code that does that:

if ( $level->billing_amount === $level->initial_payment ) {
if ( $level->cycle_number == '1' ) {
if ( ! $short ) {
$r = sprintf( __( 'The price for membership is <strong>%1$s per %2$s</strong>.', 'paid-memberships-pro' ), pmpro_formatPrice( $level->initial_payment ), pmpro_translate_billing_period( $level->cycle_period ) );
} else {
$r = sprintf( __( '<strong>%1$s per %2$s</strong>.', 'paid-memberships-pro' ), pmpro_formatPrice( $level->initial_payment ), pmpro_translate_billing_period( $level->cycle_period ) );
}
} else {
if ( ! $short ) {
$r = sprintf( __( 'The price for membership is <strong>%1$s every %2$d %3$s</strong>.', 'paid-memberships-pro' ), pmpro_formatPrice( $level->initial_payment ), $level->cycle_number, pmpro_translate_billing_period( $level->cycle_period, $level->cycle_number ) );
} else {
$r = sprintf( __( '<strong>%1$s every %2$d %3$s</strong>.', 'paid-memberships-pro' ), pmpro_formatPrice( $level->initial_payment ), $level->cycle_number, pmpro_translate_billing_period( $level->cycle_period, $level->cycle_number ) );
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants