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
/* Send billing address to PayPal even when shipping is disabled (2278024-zen) */ | |
add_filter( 'woocommerce_paypal_args', 'force_send_billing_address_to_paypal', 10 ); | |
function force_send_billing_address_to_paypal ( $args ) { | |
$args[ 'no_shipping' ] = 0; | |
return $args; | |
} |
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 woo_custom_single_image_size ( $size ) { | |
$size['height'] = 180; | |
$size['width'] = 180; | |
$size['crop'] = 1; | |
return $size; | |
} | |
add_filter('woocommerce_get_image_size_gallery_thumbnail', 'woo_custom_single_image_size', 50, 1); |
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
/* This will "normalize" the postcode entered by the customer, if the country selected is France. | |
* If the customer entered their postcode as a 5-digit number, it will add `F-` in the front. | |
* If they already entered `F-` the post code will stay as it is. | |
*/ | |
add_filter( 'woocommerce_format_postcode', 'custom_add_post_code_format_for_france', 10, 2 ); | |
function custom_add_post_code_format_for_france( $postcode, $country ){ | |
$postcode = wc_normalize_postcode( $postcode ); | |
switch ( $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_filter( 'woocommerce_email_customer_details_fields', 'add_user_id_to_woocommerce_emails', 10, 3); | |
function add_user_id_to_woocommerce_emails( $fields, $sent_to_admin, $order ) { | |
$user_id = $order->get_customer_id(); | |
$user_info = get_userdata( $user_id ); | |
$fields['user_id'] = array( | |
'label' => __( 'User ID', 'woocommerce' ), | |
'value' => $user_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
function custom_add_paypal_supported_cc_for_bolivia ( $data ) { | |
$data['BO'] = array ( | |
'Visa' => 'Visa', | |
'MasterCard' => 'MasterCard', | |
); | |
return $data; | |
} | |
add_filter ( 'woocommerce_paypal_pro_available_card_types', 'custom_add_paypal_supported_cc_for_bolivia' ); |
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 my_custom_structured_data( $markup ) { | |
$markup['name'] = 'Website name'; | |
return $markup; | |
} | |
add_filter( 'woocommerce_structured_data_website', 'my_custom_structured_data', 10, 1); |
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 woo_custom_storefront_header_size( $args ) { | |
$args['height'] = 1000; | |
return $args; | |
} | |
add_filter( 'storefront_custom_header_args', 'woo_custom_storefront_header_size' ); |
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 change_apple_pay_button_language( $stripe_params ){ | |
return 'en'; | |
} | |
add_filter( 'wc_stripe_payment_request_button_locale', 'change_apple_pay_button_language' ); |
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 remove_apple_pay_label_suffix( $stripe_params ){ | |
return ''; | |
} | |
add_filter( 'wc_stripe_payment_request_total_label_suffix', 'remove_apple_pay_label_suffix' ); |
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 custom_disable_removing_inactive_bookings ( $time ) { | |
return 0; | |
} | |
add_filter( 'woocommerce_bookings_remove_inactive_cart_time', 'custom_disable_removing_inactive_bookings', 10 ); | |
add_filter( 'woocommerce_bookings_failed_order_expire_scheduled_time_stamp', 'custom_disable_removing_inactive_bookings', 10 ); |