This file contains 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 | |
// Set expiration date for virtual products when the order is marked complete | |
add_action('woocommerce_order_status_completed', 'set_user_virtual_product_expiration', 10, 1); | |
function set_user_virtual_product_expiration($order_id) { | |
$order = wc_get_order($order_id); | |
$user_id = $order->get_user_id(); | |
if (!$user_id) return; // Ensure it's a registered user |
This file contains 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
woocommerce_paypal_payments_checkout_button_renderer_hook | |
woocommerce_paypal_payments_checkout_dcc_renderer_hook | |
woocommerce_paypal_payments_pay_order_dcc_renderer_hook | |
woocommerce_paypal_payments_proceed_to_checkout_button_renderer_hook | |
woocommerce_paypal_payments_mini_cart_button_renderer_hook | |
woocommerce_paypal_payments_single_product_renderer_hook |
This file contains 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
function cat_cart_count( $cat_name ) { | |
$cat_count = 0; | |
// Iterating through each cart item | |
foreach(WC()->cart->get_cart() as $cart_item) | |
if( has_term( $cat_name, 'product_cat', $cart_item['product_id'])) | |
$cat_count += $cart_item['quantity']; | |
return $cat_count; | |
} |
This file contains 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
/* CHAT STYLES */ | |
* { | |
font-family: Avenir, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, | |
Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, | |
Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji; | |
letter-spacing: 0.5px; | |
} | |
.ce-chat-list { | |
background-color: rgb(240, 240, 240) !important; |
This file contains 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 | |
/** | |
* Filter the settings of email frequency sent when using the Extra Expiration Warning Emails Add On | |
* https://www.paidmembershipspro.com/add-ons/extra-expiration-warning-emails-add-on/ | |
* | |
* Update the $settings array to your list of number of days => ''. | |
* Read the Add On documentation for additional customization using this filter. | |
*/ | |
function custom_pmproeewe_email_frequency( $settings = array() ) { |
This file contains 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 | |
/* | |
Plugin Name: PMPro Customizations | |
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/ | |
Description: Customizations for Paid Memberships Pro | |
Version: .1 | |
Author: Stranger Studios | |
Author URI: http://www.strangerstudios.com | |
*/ |
This file contains 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 | |
/* | |
* Display Member Number on Edit Profile Page for Admin | |
* | |
*/ | |
// We have to put everything in a function called on init, so we are sure Register Helper is loaded. | |
function my_pmprorh_init_member_number() { | |
// Don't break if Register Helper is not loaded. | |
if ( ! function_exists( 'pmprorh_add_registration_field' ) ) { |
This file contains 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 | |
/** | |
* Assign a LEVEL to a unique role with Expiration Date | |
* | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. | |
* Read this companion article for step-by-step directions on either method. | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ |
This file contains 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 will Give WooCommerce Sho[p Managers access to the dashboad of you are removing access for other users | |
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function shop_manager_show_admin_bar() { | |
if(current_user_can('shop_manager')) { | |
add_filter( 'show_admin_bar', '__return_true' ); | |
} | |
} |
NewerOlder