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_CodiceFiscaleValidator | |
{ | |
private $field_name = 'billing_codice_fiscale'; | |
private $pattern = '/^[A-Z]{6}[0-9]{2}[A-Z]{1}[0-9]{2}[A-Z]{1}[0-9]{3}[A-Z]{1}$/'; | |
public function __construct($field_name = 'billing_codice_fiscale') | |
{ | |
$this->field_name = $field_name; | |
$this->init(); | |
} |
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 FK_Rymera_Cart_Integration { | |
public function __construct() { | |
// Hook into wp_footer to output the JS | |
add_action( 'wp_footer', [ $this, 'enqueue_custom_js' ] ); | |
} | |
/** | |
* Print inline JS in the footer. | |
*/ |
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_Trigger_Add_To_cart_On_Slide_Cart { | |
public function __construct() { | |
add_action( 'wp_footer', [ $this, 'add_js' ] ); | |
} | |
public function add_js() { | |
?> | |
<script> | |
window.addEventListener('load', function () { | |
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_Notices_Handler { | |
public function __construct() { | |
add_action( 'fkcart_quick_before_view_content', [ $this, 'remove_action' ],99 ); | |
} | |
function remove_action() { | |
?> | |
<style> | |
#fkcart-modal .fkcart-quick-view-drawer .fkcart-product-form-wrap .woocommerce-variation p.stock { |
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_Display_Cart_Notice_Free_Gifts_for_WC { | |
private static $instance = null; | |
public function __construct() { | |
add_action('fkcart_after_header', [$this, 'display_cart_gift_notice']); | |
add_action('wp_footer', [$this, 'add_js']); | |
} | |
// Singleton pattern to prevent multiple instances |
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(){ | |
?> | |
<style> | |
body #wfacp-e-form .wfacp_main_form.woocommerce .shipping-notice.woocommerce-info{ | |
position: relative; | |
font-size: 1em !important; | |
color: inherit; | |
background: none; | |
border-top: 1px solid #eee !important; |
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_get_country_locale', function ( $locale ) { | |
$ARR = [ 'RO' ]; | |
foreach ( $ARR as $country_code ) { | |
$locale[ $country_code ]['postcode'] = array( | |
'required' => false, | |
); | |
} | |
return $locale; |
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_ADD_Custom_Fields_Under_Billing_Shipping { | |
public function __construct() { | |
add_action( 'after_setup_theme', [ $this, 'setup_fields_billing' ] ); | |
add_action( 'wfacp_after_checkout_page_found', [ $this, 'action' ] ); | |
} | |
public function action(){ | |
add_filter( 'woocommerce_form_field_args', [ $this, 'add_default_wfacp_styling' ], 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
//classic checkout | |
add_action( 'woocommerce_checkout_create_order', 'add_wholesale_meta_to_order', 10, 2 ); | |
//woocommerce checkout blocks | |
add_action( 'woocommerce_store_api_checkout_update_order_meta', 'new_add_wholesale_meta_to_order'); | |
function add_wholesale_meta_to_order( $order, $context ) { | |
global $wc_wholesale_prices; | |
if ( ! isset( $wc_wholesale_prices->wwp_wholesale_roles ) ) { | |
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
class FKCART_Change_Upsell_Thumbnail_Image{ | |
public function __construct() { | |
add_filter('fkcart_upsell_thumbnail_image',[$this,'change_thumbnail_image'],11,2); | |
add_action('fkcart_after_modal_container',[$this,'add_css'],11,2); | |
} | |
public function change_thumbnail_image($image,$cart_item){ | |
if (isset($cart_item['product_id'])) { | |
$product_id = $cart_item['product_id']; | |
$attachment_id = get_post_thumbnail_id($product_id); |
NewerOlder