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_Field_Validator { | |
/** | |
* Disallowed characters in checkout fields | |
*/ | |
private $disallowed_chars = array( '-', '#', '/', '\\', '=', '<', '>', '(', ')' ); | |
/** | |
* Fields to validate against disallowed characters | |
*/ |
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 to handle fields that should be shown on the next step in WooFunnels AeroCheckout Page. | |
* This class allows specific fields to be displayed on the next step of the checkout process. | |
*/ | |
class WFACP_Show_On_Next_Step_Fields { | |
/** | |
* Constructor - Initializes the class and registers the action hook. | |
*/ | |
public function __construct() { |
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_create_order', function ( $order, $data ) { | |
/** | |
* @var $order WC_Order; | |
*/ | |
$have_engraving = null; | |
foreach ( WC()->cart->get_cart_contents() as $cart_item_key => $cart_item ) { | |
if ( ! isset( $cart_item['wapf'] ) ) { | |
continue; |
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_City_FIELD_To_DROPDOWN_FOR_IL { | |
public function __construct() { | |
add_filter( 'woocommerce_form_field_args', [ $this, 'field_args' ], 10, 2 ); | |
add_action( 'wfacp_internal_css', [ $this, 'js' ] ); | |
} | |
public function field_args( $fields, $key ) { | |
if ( $key == 'shipping_postcode' || $key == 'billing_postcode' ) { | |
$fields = wp_parse_args( array( | |
'type' => 'select', |
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_Error_Coupon_Log { | |
private $logger; | |
private $log_context; | |
public function __construct() { | |
// Checkout page load | |
add_action( 'wfacp_after_checkout_page_found', [ $this, 'page_loaded' ] ); | |
// Run in ajax | |
add_action( 'wfacp_before_process_checkout_template_loader', [ $this, 'action' ] ); |
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_Subscription_price_Display { | |
public function __construct() { | |
add_filter( 'fkcart_re_run_get_slide_cart_ajax', '__return_true', 9999 ); | |
add_action( 'fkcart_wc_you_saved_price', [ $this, 'change_regular_price' ], 10, 2 ); | |
add_action( 'fkcart_wc_product_price', [ $this, 'change_sale_price' ], 10, 2 ); | |
} | |
public function change_regular_price( $regular_price, $product ) { | |
if ( WC_Subscriptions_Product::is_subscription( $product ) ) { |
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('template_redirect', 'redirect_to_account_if_not_logged_in'); | |
function redirect_to_account_if_not_logged_in() { | |
// Check if the user is trying to access the checkout page and is not logged in | |
if (is_checkout() && !is_user_logged_in()) { | |
// Redirect to the My Account page (WooCommerce login/register page) | |
wp_redirect(wc_get_page_permalink('myaccount')); | |
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
class FKCART_YITH_WooCommerce_Badge_Management_Premium { | |
public function __construct() { | |
add_action( 'fkcart_before_cart_items', [ $this, 'remove_action' ] ,9999); | |
} | |
public function remove_action() { | |
if ( ! $this->is_enabled() ) { | |
return; | |
} |
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('fkcart_before_cart_items',function (){ | |
add_filter('woocommerce_cart_totals_coupon_html',function($html){ | |
$html= str_replace('-','',$html); | |
return $html; | |
},50); | |
}); |
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 debug_log_plugin_activation($plugin) { | |
// Ensure plugin is not empty | |
if (empty($plugin)) { | |
return; // Exit if no plugin name is provided | |
} | |
// Get current user information | |
$current_user = wp_get_current_user(); | |
$user_id = isset($current_user->ID) ? $current_user->ID : 'N/A'; | |
$user_name = isset($current_user->user_login) ? $current_user->user_login : 'Guest'; |