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 add_cc_to_invoice_email($headers, $email_id, $order) { | |
if ($email_id === 'customer_invoice') { | |
$cc_email = '[email protected]'; // Replace with the email you want to CC | |
$headers .= 'Cc: ' . $cc_email . "\r\n"; | |
} | |
return $headers; | |
} | |
add_filter('woocommerce_email_headers', 'add_cc_to_invoice_email', 10, 3); |
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_handheld_search( $links ) { | |
unset( $links['search'] ); | |
return $links; | |
} | |
add_filter( 'storefront_handheld_footer_bar_links', 'remove_handheld_search' ); |
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 storefront_product_search() { | |
if ( storefront_is_woocommerce_activated() ) { | |
?> | |
<div class="site-search"> | |
<?php the_widget( 'WP_Widget_Search', 'title=' ); ?> | |
</div> | |
<?php | |
} | |
} |
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_wc_stripe_from_checkout_page( $available_gateways ) { | |
unset( $available_gateways['stripe'] ); | |
return $available_gateways; | |
} | |
add_filter( 'woocommerce_available_payment_gateways', 'remove_wc_stripe_from_checkout_page' ); |
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
/** | |
* Temp Fix for the Bookings issue below. | |
* #3459 | |
*/ | |
function temp_price_fix_bookings( $price, $product ) { | |
$target_product_types = array( | |
'booking' | |
); |
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
/** | |
* Temporary fix for Composite Products Sort by newness to Sort by latest text | |
*/ | |
function temp_order_by_text_tweak( $orderby_options ) { | |
$orderby_options['date'] = __( 'Sort by latest', 'woocommerce' ); | |
return $orderby_options; |
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 WooCommerce product category image full width under the header of the Storefront theme. | |
*/ | |
function woocommerce_category_image() { | |
if ( is_product_category() ){ | |
global $wp_query; | |
$cat = $wp_query->get_queried_object(); | |
$thumbnail_id = get_term_meta( $cat->term_id, 'thumbnail_id', true ); | |
$image = wp_get_attachment_url( $thumbnail_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 add_additonal_wc_mime_types($mime_types) { | |
$mime_types['webp'] = 'image/webp'; // Add support for webp images in the WooCommerce Product importer. | |
return $mime_types; | |
} | |
add_filter('woocommerce_rest_allowed_image_mime_types', 'add_additonal_wc_mime_types', 1, 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
add_filter( 'woocommerce_product_add_to_cart_text', function( $text ) { | |
global $product; | |
if ( $product->is_type( 'composite' ) ) { | |
$text = $product->is_purchasable() ? __( 'Custom options text', 'woocommerce' ) : __( 'Read more', 'woocommerce' ); | |
} | |
return $text; | |
}, 10 ); |
NewerOlder