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_Billing_Email_Autofill_Disabled_zoom{ | |
public function __construct() { | |
add_filter( 'wfacp_forms_field', [ $this, 'add_css_class' ], 99, 2 ); | |
add_filter('wfacp_intial_scale_default','__return_true'); | |
} | |
function add_css_class( $field, $key ) { | |
if ( $key !== 'billing_email' || !isset($field['autocomplete'])) { | |
return $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
/** | |
* Conditionally removes the FunnelKit (WooFunnels) frontend tracking scripts. | |
* | |
* This function checks if the "Track UTMs" setting in FunnelKit's general settings | |
* is disabled. If it is, it removes the action responsible for enqueuing the | |
* e-commerce tracking scripts, preventing them from being loaded on the site's frontend. | |
* | |
* It hooks into 'wp_enqueue_scripts' with a very early priority (-1) to ensure | |
* it runs before the target action is executed. | |
* |
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_meta_added', function () { | |
?> | |
<script> | |
(function watchAllScriptLoads() { | |
function loadScript(src, callback) { | |
var script = document.createElement('script'); | |
script.src = src; | |
script.onload = callback; |
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_countries_tax_or_vat', function( $label ) { | |
$country = ''; | |
// Try to get customer's country from session | |
if ( WC()->customer ) { | |
$country = WC()->customer->get_taxable_address()[0]; | |
} | |
// Fallback to store base country if no customer country yet (e.g., first visit) | |
if ( empty( $country ) ) { |
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_checkout_process', 'force_choose_shipping_method' ); | |
function force_choose_shipping_method() { | |
if ( WC()->cart->needs_shipping() ) { | |
$chosen_method = WC()->session->get( 'chosen_shipping_methods' ); | |
if ( empty( $chosen_method ) || empty( $chosen_method[0] ) ) { | |
wc_add_notice( __( 'Please select a shipping method to proceed.', 'woocommerce' ), 'error' ); | |
} | |
} |
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
// Custom function to get variation data for cart or non-cart products | |
function wc_get_flexible_item_data( $cart_item_or_product, $flat = false ) { | |
$item_data = array(); | |
$product = null; | |
$variation_data = array(); | |
// Determine if we're working with a cart item or just a product | |
if ( is_array( $cart_item_or_product ) && isset( $cart_item_or_product['data'] ) ) { | |
// Cart item | |
$product = $cart_item_or_product['data']; |
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 FKCART_Change_Reward_Total{ | |
public function __construct(){ | |
add_filter('fkcart_reward_total',[$this,'change_reward_total'],10,2); | |
} | |
public function change_reward_total($total,$calculation_mode){ | |
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_select_options_label', function ( $text, $cart_item ) { | |
if ( ! ( isset( $cart_item['cart_item']['bos4w_data'] ) && ! empty( $cart_item['cart_item']['bos4w_data']['selected_subscription'] ) ) ) { | |
$text = ''; | |
} | |
return $text; | |
} ,11,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_action( 'wfacp_internal_css', function () { | |
if(!class_exists('\Hfd\Woocommerce\Container')){ | |
return; | |
} | |
$helper = \Hfd\Woocommerce\Container::get('Hfd\Woocommerce\Helper\Spot'); | |
?> | |
<script> | |
window.addEventListener('load', function () { | |
(function ($) { |