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

Update class-pum-woocommerce-integration.php #850

Merged
merged 1 commit into from
Aug 19, 2020

Conversation

bydrewpaul
Copy link
Contributor

@bydrewpaul bydrewpaul commented Jul 13, 2020

Adding WooCommerce Subscriptions Endpoint Support.

Description

I edited your plugin to add an endpoint for a WooCommerce Subscription Plugin, and was hoping to have it updated to avoid needing to alter it each update or hack the plugin.

Related Issue

#849

Types of changes

Adding an endpoint to the WooCommerce Integration Feature.

Screenshots

Screen Shot 2020-07-12 at 9 30 53 PM

This has been tested in the following browsers

  • [ x ] Chrome
  • [ x ] Firefox
  • [ x ] Edge
  • [ x ] Safari

Checklist:

  • [ x ] My code has been tested in the latest version of WordPress.
  • [ x ] My code does not have any warnings from ESLint.
  • [ x ] My code follows the WordPress code style.
  • [ x ] My code follows the accessibility standards.
  • All new functions and classes have code documentation.

Adding WooCommerce Subscriptions Endpoint Support.
@fpcorso
Copy link
Contributor

fpcorso commented Jul 13, 2020

@bydrewpaul Thanks for the pull request!

This seems straightforward enough so I don't anticipate any problems with merging this. We'll get it tested out and try to get it merged for the next release.

@fpcorso
Copy link
Contributor

fpcorso commented Jul 13, 2020

@bydrewpaul Side note: If you leave out any spaces before and after the x inside the [], GitHub will automatically convert them into checkboxes. I edited the last checkbox in your post to show you what that would be like.

@danieliser
Copy link
Member

@bydrewpaul - Much appreciate the PR. I need to double check that this isn't already part of our premium WooCommerce offerings before we merge it as we have a lot of targeting upgrades related to WooCommerce Subscriptions in there. If it is we will need to decide internally how to proceed as any time we move a paid feature to free we can never reverse it.

Otherwise yea its a simple enough change to merge quickly for the next update.

That said you can stop hacking it and use the filter so it won't be an issue if any updates come before this merges.

add_filter( 'pum_registered_conditions', function ( $conditions ) {
    $conditions['is_wc_endpoint_url']['fields']['selected']['options']['subscriptions'] = 'subscriptions';

    return $conditions;
}, 11 );

@fpcorso fpcorso changed the base branch from master to develop August 19, 2020 19:24
@fpcorso fpcorso merged commit 45908d7 into PopupMaker:develop Aug 19, 2020
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.

3 participants