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( 'woocommerce_email_enabled_customer_new_account', function( $enabled, $object ) { | |
| // Check if we're in a checkout/order processing context with a Sublium plan in cart | |
| if ( WC()->cart && \Sublium_WCS\Includes\Main\Cart::get_instance()->cart_contains_plan() ) { | |
| return false; | |
| } | |
| return $enabled; | |
| }, 10, 2 ); |
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( 'fkcart_reward_rules_checking', function ( $skip, $reward ) { | |
| if ( 'freegift' !== strval( $reward['type'] ) || ! WC()->cart ) { | |
| return $skip; | |
| } | |
| foreach ( WC()->cart->get_cart() as $item ) { | |
| if ( ! empty( $item['_fkcart_free_gift'] ) ) { | |
| continue; | |
| } | |
| $id = ! empty( $item['variation_id'] ) ? wp_get_post_parent_id( $item['variation_id'] ) : $item['product_id']; | |
| if ( $id && has_term( 'gift-card', 'product_cat', $id ) ) { |
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: WFOCU - Show Signup Fee as Offer Price (Lifetime Subscriptions) | |
| * Description: For products flagged lifetime by "Lifetime Subscriptions for WooCommerce", display the signup fee as the offer price and hide the signup / recurring rows. | |
| */ | |
| 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
| add_filter( 'woocommerce_update_order_review_fragments', function ( $fragments ) { | |
| if ( ! class_exists( 'WFACP_Common' ) || ! defined( 'BRICKS_DB_PAGE_CONTENT' ) ) { | |
| return $fragments; | |
| } | |
| $tpl = wfacp_template(); | |
| if ( ! $tpl ) { | |
| return $fragments; | |
| } | |
| foreach ( (array) get_post_meta( WFACP_Common::get_id(), BRICKS_DB_PAGE_CONTENT, true ) as $el ) { | |
| if ( ( $el['name'] ?? '' ) === 'wfacp-order-summary' && ! empty( $el['id'] ) ) { |
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( 'pre_do_shortcode_tag', function ( $override, $tag ) { | |
| if ( 'woocommerce_checkout' !== $tag || ! is_page( 'checkout' ) || ! class_exists( 'WFACP_Common' ) ) { | |
| return $override; | |
| } | |
| $post = get_post( WFACP_Common::get_id() ); | |
| return $post ? do_shortcode( do_blocks( $post->post_content ) ) : $override; | |
| }, 10, 2 ); |
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 | |
| /** | |
| * Move Order Summary + Coupon above the Place Order button on WFACP Elementor checkout. | |
| * Place Order button and all other elements stay exactly where they are. | |
| */ | |
| class Pvst_Order_Summary_Position_Above_PlaceOrder_Elementor { | |
| public function __construct() { | |
| add_action( 'wfacp_after_checkout_page_found', [ $this, 'enabled_term_condition' ] ); | |
| add_filter( 'woocommerce_checkout_posted_data', [ $this, 'remove_validation' ], 60 ); |
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_action( 'wp_footer', function () { | |
| if ( ! function_exists( 'is_checkout' ) || ! is_checkout() ) { | |
| return; | |
| } | |
| ?> | |
| <script> | |
| jQuery(function ($) { | |
| function syncVatRequired() { | |
| var required = $('#customer_type').val() === 'azienda'; | |
| var $field = $('#vat_number_field'); |
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_action( 'woocommerce_cart_calculate_fees', 'fk_multi_category_discount', 20, 1 ); | |
| function fk_multi_category_discount( $cart ) { | |
| if ( is_admin() && ! defined( 'DOING_AJAX' ) ) return; | |
| // ------------------------------------------------------- | |
| // CONFIGURATION — Add as many categories as needed | |
| // category_id/slug => discount percentage | |
| // ------------------------------------------------------- |
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 | |
| /** | |
| * Restore strikethrough HTML for FunnelKit Cart free-gift / reward items | |
| * when "WooCommerce Product Batch Expiry Tracking and Notifications" is active. | |
| * | |
| * The batch plugin filters woocommerce_cart_item_subtotal at priority 9999 | |
| * with an unconditional wc_price() call that wipes the <del>/<ins> markup | |
| * the rewards system produces. We re-apply the strikethrough at a higher | |
| * priority — but only for cart lines flagged as free gifts. | |
| */ |
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: Saved Addresses → Trigger Field Change Events | |
| * Description: The "Saved Addresses for WooCommerce" plugin auto-fills checkout | |
| * address fields via jQuery .val() but never triggers input/change | |
| * events. That breaks floating-label libraries (labels stay in | |
| * their empty-state position over the filled value), WC's | |
| * update_checkout listeners, and any third-party validators bound | |
| * to those fields. This snippet listens for the plugin's two AJAX | |
| * actions and dispatches input/change/keyup/blur on every populated | |
| * billing & shipping field after the response handler finishes. |