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

FIX hide decimals #21

Closed
wants to merge 1 commit into from
Closed

FIX hide decimals #21

wants to merge 1 commit into from

Conversation

ipokkel
Copy link
Member

@ipokkel ipokkel commented Dec 1, 2021

All Submissions:

Changes proposed in this Pull Request:

Fix breaking of cost text if multiple occurrences of currency amounts appear in $cost string value.

Resolves strangerstudios/pmpro-subscription-delays#25

How to test the changes in this Pull Request:

  1. In a new WordPress installation with Memberlite theme active add and activate PMPro Core and Sub Delays Add On
  2. Create Test Level "Sub Delay level one" with 0 Initial Payment, check Recurring Subscription, set Billing Amount to 100 per 1 Year(s). Set Subscription delay to 7`.
  3. Create Test Level "Sub Delay level two" with 200 Initial Payment, check Recurring Subscription, set Billing Amount to 300.5 per 1 Month(s). Set Subscription delay to 2022-01-23`
  4. Navigate Membership Levels page to observe level cost text:
    4.1 Sub Delay level one: $0.00 now and then $100.00 per Year after your 7 day trial.
    4.2 Sub Delay level two: $200.00 now and then $300.50 per Month starting January 23, 2022.
  5. Install and activate Custom Level Cost Text Add On.
  6. Navigate to Memberships > Settings > Advanced and set the Hide Unnecessary Decimals option for Level Cost Text Settings to Yes and save settings.
  7. Navigate to the Membership Levels page on the frontend and observe level cost text
    7.1 Sub Delay level one: $0
    7.2 Sub Delay level two: $200
  8. Replace pmpro_hide_decimals code with this patch
  9. Navigate to the Membership Levels page on the frontend and observe level cost text
    9.1 Sub Delay level one: $0 now and then $100 per Year after your 7 day trial.
    9.2 Sub Delay level two: $200 now and then $300.50 per Month starting January 23, 2022.
Screenshots

Default Level Cost Text
211201-1638335933


Level Cost Text before the patch
211201-1638336086


Level Cost Text after the patch
211201-1638336365


Level Cost Text after the patch - all PCLCT settings enabled
211201-1638339889


Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you successfully run tests with your changes locally?

Changelog entry

BUG FIX: Fix breaking of cost text if multiple occurrences of currency amounts appear in $cost string value.

Use string replace. Fixes breaking of cost text if multiple occurrences of currency amounts appear in $cost string value.
@michaelbeil michaelbeil mentioned this pull request Dec 7, 2022
2 tasks
This pull request was closed.
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

Successfully merging this pull request may close these issues.

BUG: Message doesn’t include subscription amount and time
1 participant