Skip to content

Instantly share code, notes, and snippets.

@wooexperte
wooexperte / paypal woocommerce
Last active September 21, 2021 11:44
Aktiviert PayPal Standard in WooCommerce
add_filter( 'woocommerce_should_load_paypal_standard', '__return_true' );
add_filter( 'woocommerce_cross_sells_total', 'qreuz_modify_cross_sells_count', 20 );
function qreuz_modify_cross_sells_count( $columns ) {
$cross_sells = 6;
return $cross_sells; // define how many cross sell products shall max. be shown on the cart page
}
@wooexperte
wooexperte / gist:c70353f868e29df3869f89a0229ec7d9
Created March 28, 2019 15:09
Steueranpassung WooCommerce deaktivieren
add_filter( 'woocommerce_adjust_non_base_location_prices', '__return_false' );
@wooexperte
wooexperte / Meta Daten WooCommerce deaktivieren
Created March 5, 2019 17:07
Meta Daten WooCommerce deaktivieren
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40 );
@wooexperte
wooexperte / Abstand Anker Header Website
Created March 5, 2019 15:49
Abstand Anker Header Website
.Anker {
padding-top: 165px;
margin-top: -165px;
}
@wooexperte
wooexperte / Individueller Warenkorb mit URL
Last active February 13, 2019 14:59
Individueller Warenkorb mit URL
https://website.com/warenkorb/?fill_cart=2x296,284,276
@wooexperte
wooexperte / WooCommerce – Zwang zur Passwortstärke entfernen
Created February 5, 2019 08:47
WooCommerce – Zwang zur Passwortstärke entfernen
[php light="true"]function wc_ninja_remove_password_strength() {
if ( wp_script_is( 'wc-password-strength-meter', 'enqueued' ) ) {
wp_dequeue_script( 'wc-password-strength-meter' );
}
}
add_action( 'wp_print_scripts', 'wc_ninja_remove_password_strength', 100 );[/php]
@wooexperte
wooexperte / Anzeige “Angebot!” ausblenden?
Last active January 17, 2019 15:25
WooCommerce Snippet
remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_show_product_loop_sale_flash', 10 );
remove_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_sale_flash', 10 );
@wooexperte
wooexperte / WooCommerce Snippet Zahlungsarten auf ein Land begrenzen
Last active January 9, 2019 08:22
WooCommerce Snippet Zahlungsarten auf ein Land begrenzen
function payment_gateway_disable_country( $available_gateways ) {
global $woocommerce;
if ( is_admin() ) return;
if ( isset( $available_gateways['cash_on_delivery'] ) && $woocommerce->customer->get_billing_country() <> 'DE' ) // Ländercode und Zahlungs ID anpassen
{
unset( $available_gateways['cash_on_delivery'] ); // Zahlungs ID anpassen
}
return $available_gateways;
}
@wooexperte
wooexperte / WooCommerce Snippet - Bildeffekt Produktbild deaktivieren
Last active December 13, 2018 15:00
WooCommerce Snippet - Zoom Produktbild deaktivieren
function custom_single_product_image_html( $html, $post_id ) {
$post_thumbnail_id = get_post_thumbnail_id( $post_id );
return get_the_post_thumbnail( $post_thumbnail_id, apply_filters( 'single_product_large_thumbnail_size', 'shop_single' ) );
}
add_filter('woocommerce_single_product_image_thumbnail_html', 'custom_single_product_image_html', 10, 2);