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); |
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_Custom_Field_In_Advanced { | |
public function __construct() { | |
/* Register Add field */ | |
add_filter( 'wfacp_advanced_fields', [ $this, 'add_field' ], 20 ); | |
} | |
public function add_field( $fields ) { | |
$fields['billing_company'] = [ | |
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
/** | |
* Print custom JS in <head> on all FunnelKit funnel step pages. | |
*/ | |
function fb_print_funnelkit_head_js() | |
{ | |
// Skip for admin or feeds | |
if (is_admin() || is_feed()) { | |
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_Custom_Html_After_Button{ | |
public function __construct() { | |
add_action('fkcart_after_checkout_button',[$this,'display_html']); | |
add_action('wp_footer',[$this,'add_js']); | |
} | |
public function display_html(){ | |
?> | |
<div class="fkcart_custom_wrap"> |
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_Address_1_Custom_field { | |
protected $unset_key = "shipping"; | |
protected $dropdown_key = "coderockz_woo_delivery_delivery_selection_box"; | |
private $fields=[ | |
'label' => 'Street address', | |
'placeholder' => '', | |
'required' => 'true', | |
'class' => [ | |
'wfacp-form-control-wrapper ', |
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_Bump_Product_class { | |
public function __construct() { | |
add_action( 'wfacp_template_load', [ $this, 'actions' ] ); | |
} | |
public function actions() { | |
add_action( 'woocommerce_cart_item_class', [ $this, 'add_cart_item_class' ], 12, 3 ); | |
} | |
public function add_cart_item_class($class, $cart_item, $cart_item_key){ |
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_before_process_checkout_template_loader', 'add_wfacp_action' ); | |
add_action( 'wfacp_checkout_page_found', 'add_wfacp_action' ); | |
function add_wfacp_action() { | |
add_filter( 'wc_cart_totals_shipping_method_cost', 'check_shipping_cost', 99, 2 ); | |
} | |
function check_shipping_cost( $output, $method ) { | |
$has_cost = $method->cost; |
NewerOlder