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 | |
| /** | |
| * FunnelKit Cart: show the reward progress bar on the WooCommerce cart page, kept in sync with the slide cart. | |
| * | |
| * Renders FunnelKit Cart's own rewards template above the cart table and adds it to FunnelKit Cart's | |
| * fragments, so every slide cart refresh replaces it too. Changes made on the cart page itself | |
| * (quantity, coupon) ask FunnelKit Cart to refresh. | |
| */ | |
| function fk_cart_page_rewards_html() { |
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 | |
| /** | |
| * FunnelKit Stripe: don't save the card for Google Pay payments. | |
| * | |
| * Google Pay payments are sent as one-time payments (no setup_future_usage=off_session), so banks | |
| * ask for 3D Secure less often. Apple Pay, card payments and subscription orders still save the card. | |
| * A Google Pay order has no saved card to charge again, so its one-click upsell is skipped. | |
| */ | |
| function fk_wallet_no_save_is_wallet_order( $order ) { |
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
| /** | |
| * Plugin Name: Sublium - Order bump discount on the first payment only | |
| * Description: A Funnel Builder order bump discount on a subscription product applies to the first payment only. Every renewal, whatever the billing frequency, is charged at the full plan price. | |
| * Version: 1.0.0 | |
| * | |
| * Install as a must-use plugin (wp-content/mu-plugins/) or as a Code Snippets entry | |
| * (everything below the opening tag, run everywhere). | |
| * | |
| * How it works | |
| * - Sublium stores the discounted price on the subscription at purchase time and |
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 | |
| /** | |
| * Plugin Name: Sublium Choose Plan Label (test) | |
| * Description: Shows "Choose Plan" in the Sublium plan-selector trigger box and, when the Subscription option is active but no plan has been picked, blocks add-to-cart and shows a "Please select a subscription plan." message instead of silently disabling the button. | |
| */ | |
| 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 | |
| /** | |
| * FunnelKit phone trace (temporary). Logs, for express wallet orders only, the billing/shipping phone | |
| * at each step from the wallet to WooCommerce's validation, with every digit masked as "9". | |
| * Log: WooCommerce > Status > Logs > source "fk-phone-trace". | |
| */ | |
| add_action( 'woocommerce_before_checkout_process', function () { | |
| if ( empty( $_POST['payment_request_type'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing | |
| return; // Not an express wallet order. | |
| } |
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( | |
| 'wfocu_offer_product_types', | |
| function ( $types ) { | |
| // Only expose bundles when WooCommerce Product Bundles is actually active. | |
| if ( class_exists( 'WC_Product_Bundle' ) && ! in_array( 'bundle', (array) $types, true ) ) { | |
| $types[] = 'bundle'; | |
| } | |
| return $types; | |
| } | |
| ); |
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 | |
| /** | |
| * Plugin Name: Sublium - Renewal check every 5 minutes | |
| */ | |
| if ( ! defined( 'ABSPATH' ) ) { | |
| exit; | |
| } | |
| add_filter( |
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
| function fk_merchant_center_id( $content_id, $product_id ) { | |
| $map = array( | |
| 11487 => 'KLW', // KLOW | |
| 12092 => 'ss', // SS-31 | |
| 7466 => '5157472594', // Glutathione | |
| ); | |
| return isset( $map[ $product_id ] ) ? $map[ $product_id ] : $content_id; | |
| } | |
| add_filter( 'wffn_get_product_content_id', 'fk_merchant_center_id', 10, 2 ); // purchase + sitewide events | |
| add_filter( 'wfocu_get_product_content_id', 'fk_merchant_center_id', 10, 2 ); // upsell purchases |
NewerOlder