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

Adding filters for formatted order total, subtotal, tax #3009

Merged

Conversation

dparker1005
Copy link
Member

All Submissions:

Changes proposed in this Pull Request:

Adds the following filters to adjust how an order's total, subtotal, and tax values are displayed across PMPro:

  • pmpro_order_formatted_total
  • pmpro_order_formatted_subtotal
  • pmpro_order_formatted_tax

Opened as an alternative to #2988

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

Enter a summary of all changes on this Pull Request. This will appear in the changelog if accepted.

@dparker1005 dparker1005 added this to the 3.1 milestone Jun 13, 2024
@louiswol94
Copy link

@dparker1005 this is great!

@dparker1005 dparker1005 merged commit fa043ab into strangerstudios:v3.1 Jun 19, 2024
@dparker1005 dparker1005 deleted the abstract-order-price-formatting branch June 19, 2024 17:29
@louiswol94
Copy link

louiswol94 commented Jun 20, 2024

Screenshot 2024-06-20 at 10 24 21 PM

Hey @dparker1005

I found one instance so far where we also need to filter.

$subscription->get_cost_text()

WDYT?

@louiswol94
Copy link

I think if we can add a filter for get_cost_text() then we will be getting really close to a full integration 😄
BTW, I am loving the UI updates you guys have been making!

@louiswol94
Copy link

@dparker1005 Sorry for all the messages.

It looks like this PR caused an error on one specific page. /adminpages/member-edit/pmpro-class-member-edit-panel-orders.php

The orders on this page are just results from the DB and not Order objects as such.

Screenshot 2024-06-21 at 9 50 16 AM

@louiswol94
Copy link

Screenshot 2024-06-20 at 10 24 21 PM Hey @dparker1005

I found one instance so far where we also need to filter.

$subscription->get_cost_text()

WDYT?

https://github.com/strangerstudios/paid-memberships-pro/pull/3018/files

@dparker1005
Copy link
Member Author

Hi @louiswol94, thank you for the feedback!

I have opened #3020 to address the fatal error and #3021 to add the pmpro_subscription_cost_text filter. Please feel free to review those and let us know if you have any additional feedback

@louiswol94
Copy link

Thanks @dparker1005 , you are very quick!

Regarding the cost text filter, you will see in my PR I added a getter for membership_level_id, we need to at least be able to access the Level ID in the callback function for my scenario.

With your current filter, it does not really help much AFAIU, because all the subscription data is protected.

Wdyt?

@dparker1005
Copy link
Member Author

Hi @louiswol94,

You should be able to call $subscription->get_membership_level_id() without it being explicitly defined in the PMPro_Subscription class as a result of the magic __call() method. If that is not working, can you please link me to the code that you are using and I can take a closer look?

@louiswol94
Copy link

Hi @louiswol94,

You should be able to call $subscription->get_membership_level_id() without it being explicitly defined in the PMPro_Subscription class as a result of the magic __call() method. If that is not working, can you please link me to the code that you are using and I can take a closer look?

@dparker1005 Ah I missed that, thanks! Seems to be working :)

Do you guys have an ETA for the 3.1 release?

@dparker1005
Copy link
Member Author

I am glad to hear that method is now working!

We do not typically speculate on release dates for our plugins as release schedules depend on a number of uncontrollable variables including the time required to confidently test all of the merged changes on different site setups.

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.

None yet

2 participants