add_filter( 'wc_product_sku_enabled', '__return_false' );
add_filter( 'woocommerce_single_product_slider_enabled', '__return_false' );
add_filter( 'woocommerce_single_product_lightbox_enabled', '__return_false' );
add_filter( 'woocommerce_single_product_zoom_enabled', '__return_false' );
function my_post_queries( $query ) {
if (!is_admin() && $query->is_main_query()){
if(is_category()){
$query->set('posts_per_page', 3);
}
}
}
add_action( 'pre_get_posts', 'my_post_queries' );
add_filter( 'woocommerce_single_product_image_thumbnail_html', 'custom_remove_product_link' );
function custom_remove_product_link( $html ) {
return strip_tags( $html, '<div><img>' );
}
function mytheme_add_woocommerce_support() {
add_theme_support( 'woocommerce' );
}
add_action( 'after_setup_theme', 'mytheme_add_woocommerce_support' );
add_filter( 'woocommerce_breadcrumb_defaults', 'wcc_change_breadcrumb_home_text' );
function wcc_change_breadcrumb_home_text( $defaults ) {
$defaults['home'] = 'Webshop';
return $defaults;
}
add_filter( 'woocommerce_breadcrumb_home_url', 'woo_custom_breadrumb_home_url' );
function woo_custom_breadrumb_home_url() {
return '/winkel/';
}
add_filter( 'woocommerce_breadcrumb_defaults', 'wcc_change_breadcrumb_delimiter' );
function wcc_change_breadcrumb_delimiter( $defaults ) {
$defaults['delimiter'] = ' <i class="fa fas"></i> ';
return $defaults;
}
add_filter( 'wc_product_sku_enabled', '__return_false' );
add_theme_support( 'wc-product-gallery-zoom' );
add_theme_support( 'wc-product-gallery-slider' );
// Remove all currency symbols
function sww_remove_wc_currency_symbols( $currency_symbol, $currency ) {
$currency_symbol = '';
return $currency_symbol;
}
add_filter('woocommerce_currency_symbol', 'sww_remove_wc_currency_symbols', 10, 2);
// Remove Categories from Single Products
remove_action( 'woocommerce_single_product_summary',
'woocommerce_template_single_meta', 40 );
// wijzig teksten Coupon
add_filter( 'gettext', 'bt_rename_coupon_field_on_cart', 10, 3 );
add_filter( 'woocommerce_coupon_error', 'bt_rename_coupon_label', 10, 3 );
add_filter( 'woocommerce_coupon_message', 'bt_rename_coupon_label', 10, 3 );
add_filter( 'woocommerce_cart_totals_coupon_label', 'bt_rename_coupon_label',10, 1 );
add_filter( 'woocommerce_checkout_coupon_message', 'bt_rename_coupon_message_on_checkout' );
function bt_rename_coupon_field_on_cart( $translated_text, $text, $text_domain ) {
if ( is_admin() || 'woocommerce' !== $text_domain ) {
return $translated_text;
}
if ( 'Coupon:' === $text ) {
$translated_text = 'Kortingscode:';
}
if ('Coupon has been removed.' === $text){
$translated_text = 'Kortingscode is verwijderd.';
}
if ( 'Apply coupon' === $text ) {
$translated_text = 'Kortingscode toepassen';
}
if ( 'Coupon code' === $text ) {
$translated_text = 'Kortingscode';
}
if ( 'Coupon;' === $text ) {
$translated_text = 'Kortingscode';
}
return $translated_text;
}
// Rename the "Have a Coupon?" message on the checkout page
function bt_rename_coupon_message_on_checkout() {
return 'Heb je een kortingscode?' . ' ' . __( 'Click here to enter your code', 'woocommerce' ) . '';
}
function bt_rename_coupon_label( $err, $err_code=null, $something=null ){
$err = str_ireplace("Coupon","Voucher Code ",$err);
return $err;
}