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($) { | |
| function updateSwatchLabel(form) { | |
| $(form).find('.ct-variation-swatches').each(function() { | |
| var sel = this.querySelector('select'); | |
| if (!sel) return; | |
| var attr = (sel.dataset.attribute_name || '').replace('attribute_', ''); | |
| var val = sel.value; |
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
| /** | |
| * Exclude bundled product upsells from cart "Frequently Bought Together". | |
| * Drop this in wp-content/mu-plugins/ or add to theme functions.php. | |
| * | |
| * Requires: WooCommerce Product Bundles + FunnelKit Cart + fkcart_upsell_ids filter in upsells.php | |
| */ | |
| add_filter( 'fkcart_upsell_ids', function ( $upsell_ids ) { | |
| if ( ! WC()->cart || empty( $upsell_ids ) ) { | |
| return $upsell_ids; | |
| } |
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( 'wfacp_show_select_option_link_mini_cart', '__return_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( '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_head', function () { | |
| ?> | |
| <style> | |
| .fkcart-drawer-content .nasa-buy-now, | |
| .fkcart-drawer-content input[name="nasa_buy_now"] { | |
| display: none !important; | |
| } | |
| </style> | |
| <?php | |
| }, 999 ); |
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)); |
NewerOlder