| tags | ||
|---|---|---|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Consider member prices a "sale" so regular price is shown with a strikethrough | |
| * If PMPro WooCommerce is active and setup to discount prices, | |
| * then the calls to $product->get_price() will be filtered to return | |
| * the member price. | |
| * | |
| * Add this code to a custom plugin. | |
| */ | |
| function my_pmprowoo_woocommerce_product_is_on_sale( $on_sale, $product ) { | |
| $regular_price = (float) $product->get_regular_price(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * This code recipe will allow you to hide products on the shop page by their category according to user's membership levels. | |
| * This example uses category-1, category-2 and category-3 as category examples. | |
| * This code will also stop users from purchasing products if they manage to find these products directly. | |
| * Add this code (from line 2) to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| */ | |
| /** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Change cancellation to set expiration date for next payment instead of cancelling immediately. | |
| * | |
| * Assumes orders are generated for each payment (i.e. your webhooks/etc are setup correctly). | |
| * | |
| * Since 2015-09-21 and PMPro v1.8.5.6 contains code to look up next payment dates via Stripe and PayPal Express APIs. | |
| */ | |
| /** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Ensure Paid Memberships Pro compatibility when using the Elementor Page Builder: | |
| * https://wordpress.org/plugins/elementor/ | |
| * | |
| * Your administrator-level account must have a Membership Level in order to edit all of the pages assigned | |
| * under Memberships > Pages. | |
| * | |
| * You must also set a Custom Field on the Membership Checkout page with the key 'pmpro_default_level' and | |
| * value of a level ID in order to properly edit your Membership Checkout page using Elementor. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * This stops users from purchasing a lower level membership through WooCommerce. (Assume lower level ID is '1') | |
| * If user has level 2 or 3, stop them from purchasing level 1 membership. | |
| * Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| */ | |
| // Stop users from purchasing a lower membership level via WooCommerce. | |
| function pmpro_lower_level_is_purchasable( $is_purchasable, $product ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* CSS Document */ | |
| #pmpro_payment_method span a { | |
| background-position: left bottom; | |
| background-size: contain; | |
| background-repeat: no-repeat; | |
| display: inline-block; | |
| margin-left: 1%; | |
| max-width: 300px; | |
| padding-bottom: 60px; | |
| text-align: left; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * This function allows you to restrict a single WooCommerce product to non-members (disables add to cart button) | |
| * Price will still be displayed. | |
| * Add the following code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| */ | |
| function hide_add_to_cart_for_non_members( ){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Redirect user's to a new URL instead of the 'levels' page in PMPro. | |
| * Add this code to your PMPro Customizations plugin - http://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| */ | |
| function redirect_users_to_a_new_page( $url ){ | |
| return 'https://some-url.com'; //change this to the URL you would like to redirect your user's to. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| remove_filter( 'wp_mail_content_type', 'pmpro_wp_mail_content_type' ); |