strangerstudios / sitewide-sales

Run Black Friday, Cyber Monday, or other flash sales on your WordPress-powered eCommerce or membership site with WooCommerce, Easy Digital Downloads, and Paid Memberships Pro.
https://sitewidesales.com
GNU General Public License v3.0
3 stars 6 forks source link

Using default level and discount code filters #143

Closed dparker1005 closed 9 months ago

dparker1005 commented 1 year ago

All Submissions:

Changes proposed in this Pull Request:

Should only be merged once this PR is confirmed to be merged into the PMPro v3.0 branch: https://github.com/strangerstudios/paid-memberships-pro/pull/2506

The PMPro pull request prefixes the level and discount_code URL parameters at checkout. Since Sitewide Sales programmatically sets the level and discount code, we need to make changes in this plugin to support PMPro v3.0.

This PR updates the automatic level/discount code logic to use filters instead of updating the $_REQEUST variables directly. In addition to adding compatibility with PMPro v3.0, this is also "the WordPress way" to do things.

Other information:

Changelog entry

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

dparker1005 commented 1 year ago

Note: To test this, you must check out the PMPro 3.0 branch.