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 | |
| /** | |
| * Calculate points based on total amount instead of per-product | |
| * Useful when plugins give some products for free | |
| * 10 points per $1 spent (excluding shipping) | |
| */ | |
| // For cart/checkout display | |
| add_filter('wpgens_loyalty_cart_points_after_discount', function($total_points, $cart, $discount_ratio) { |
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 | |
| /** | |
| * Limit TOTAL discount (coupons + points) to a maximum percentage | |
| * | |
| * This ensures customers can't stack coupon codes with points | |
| * to get more than a specified total discount. | |
| */ | |
| add_filter('wpgens_loyalty_calculate_points_discount', function($discount_amount, $points, $conversion_rate) { | |
| if (!function_exists('WC') || !WC()->cart) { |
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
| add_filter('wpgens_loyalty_get_redeem_actions', 'restrict_redeem_actions_by_rank', 10, 2); | |
| function restrict_redeem_actions_by_rank($redeem_actions, $user_id) { | |
| if (!$user_id || !class_exists('WPGL_Ranks_Core')) { | |
| return $redeem_actions; | |
| } | |
| // Define which rewards require which ranks | |
| // Use the redeem action ID (visible in admin) and rank slug or ID | |
| $rank_requirements = [ |
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
| /** | |
| * Recalculate loyalty points when an order is updated in admin | |
| */ | |
| add_action('woocommerce_process_shop_order_meta', 'recalculate_loyalty_points_on_order_update', 50, 1); | |
| function recalculate_loyalty_points_on_order_update($order_id) { | |
| $order = wc_get_order($order_id); | |
| if (!$order) { | |
| return; | |
| } |
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
| /** | |
| * Hide referral link/code if user hasn't purchased a specific product | |
| * | |
| * @param bool $hide Current hide status | |
| * @param int $user_id Current user ID | |
| * @return bool Whether to hide the referral link | |
| */ | |
| add_filter('gens_raf_hide_referral_link', function($hide, $user_id) { | |
| // If already hidden, keep it hidden | |
| if ($hide) { |
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 | |
| /** | |
| * WooCommerce Subscription Integration for Points & Rewards | |
| * | |
| * Automatically applies available points as discount during subscription renewals | |
| * | |
| * @since 1.0.0 | |
| */ | |
| class WPGL_WooCommerce_Subscription |
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
| 2025-11-25T11:17:54+00:00 ERROR Array | |
| ( | |
| [title] => ==== PERFORM REMOTE REQUEST ==== | |
| [message] => This is a performed remote request. | |
| [data] => Array | |
| ( | |
| [request] => Array | |
| ( | |
| [endpoint] => https://e6e203eb98a4ca95-FamilleCarabelloBaumSAS-checkout-live.adyenpayments.proxypoc.woosa.com/checkout/v70/payments | |
| [headers] => Array |
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 | |
| /** | |
| * WPGens RAF Events | |
| * @author WPGens | |
| */ | |
| if ( ! defined( 'ABSPATH' ) ) { | |
| exit; | |
| } |
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 | |
| /** | |
| * Multisite Points Synchronization for WPGens Loyalty Program | |
| * Keeps points synchronized across all sites in a multisite network | |
| */ | |
| class WPGL_Multisite_Points_Sync { | |
| private static $syncing = false; // Prevent infinite loops | |
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 | |
| add_filter('wpgens_loyalty_cart_points_after_discount', function($total_points, $cart, $discount_ratio) { | |
| // Calculate points based on actual cart total | |
| $cart_total = $cart->get_total('edit'); | |
| // Optional: Exclude shipping from points calculation | |
| $cart_total_without_shipping = $cart_total - $cart->get_shipping_total() - $cart->get_shipping_tax(); | |
| // 1 point for every 10 dollars spent |
NewerOlder