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( 'wfacp_checkout_page_found', function( $wfacp_id ) { | |
| // Only run if Greenshift is active | |
| if ( ! function_exists( 'gspb_get_final_css' ) ) { | |
| return; | |
| } | |
| // Get queried object ID (WooCommerce checkout page) | |
| $queried_id = get_queried_object_id(); | |
| // If they're the same, Greenshift will handle it |
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 | |
| /** | |
| * Hide billing address section when cart total is zero (free products) | |
| */ | |
| $hide_billing_init = function() { | |
| static $done = false; | |
| if ( $done ) return; | |
| $done = true; | |
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 | |
| /** | |
| * Hide billing address section when cart total is zero (free products) | |
| */ | |
| $hide_billing_init = function() { | |
| static $done = false; | |
| if ( $done ) return; | |
| $done = true; | |
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 () { | |
| ?> | |
| <script> | |
| (function($) { | |
| $(document.body).on('fkcart_cart_quick_view_open', function() { | |
| setTimeout(function() { | |
| var $form = $('.fkcart-drawer-content .variations_form'); | |
| if ($form.length && typeof $.fn.nasa_attr_ux_variation_form === 'function') { | |
| $form.removeClass('nasa-attr-ux-form').addClass('nasa-attr-ux-form'); | |
| $form.nasa_attr_ux_variation_form(); |
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
| // To enable override (charge full shipping): | |
| add_filter( 'wfocu_dynamic_shipping_override', '__return_true' ); | |
| // To add shipping to subscriptions: | |
| add_filter( 'wfocu_subscription_args', function( $args, $get_product, $product, $subscription_order ) { | |
| $args['add_shipping'] = true; | |
| return $args; | |
| }, 10, 4 ); |
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
| // To enable override (charge full shipping): | |
| add_filter( 'wfocu_dynamic_shipping_override', '__return_true' ); | |
| // To add shipping to subscriptions: | |
| add_filter( 'wfocu_subscription_args', function( $args, $get_product, $product, $subscription_order ) { | |
| $args['add_shipping'] = true; | |
| return $args; | |
| }, 10, 4 ); |
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_action( 'wfacp_after_checkout_page_found', function () { | |
| add_action( 'wp_footer', function () { | |
| ?> | |
| <script> | |
| window.addEventListener('load', function () { | |
| (function ($) { | |
| function extractValueByType(components, typeKey, nameType = 'long_name') { | |
| const match = components.find(comp => comp.types.includes(typeKey)); |
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( 'fkwcs_stripe_payment_icons', function( $icons ) { | |
| // Use an external image URL | |
| $icons['afterpay_clearpay'] = '<img src="https://example.com/path/to/your-clearpay-icon.svg" class="stripe-afterpay-icon stripe-icon" alt="afterpay" style="width:auto;height:24px" />'; | |
| return $icons; |
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
| class WFACP_Hide_Billing_Fields_On_Zero_Cart { | |
| protected $field_key = 'billing'; | |
| public function __construct() { | |
| add_action( 'wfacp_before_process_checkout_template_loader', [ $this, 'init' ] ); | |
| add_action( 'wfacp_after_checkout_page_found', [ $this, 'init' ] ); | |
| } | |
| /** | |
| * Initialize hooks |
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 | |
| /** | |
| * Trust Payments + FunnelKit Checkout Compatibility Snippet | |
| * | |
| * Fixes two issues when using Trust Payments gateway with FunnelKit Checkout: | |
| * 1. "Form with id: 'st-form' does not exist" - SDK expects st-form but FunnelKit uses wfacp_checkout_form | |
| * 2. "Invalid card details" validation error - tp_valid_card_detail hidden field missing from form | |
| * | |
| * Usage: Add this code to your theme's functions.php or a custom plugin. | |
| * |
NewerOlder