This file contains 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
/* | |
* WooCommerce - Ähnliche Produkte ausblenden | |
* https://wooexperte.de/snippet/woocommerce-aehnliche-produkte-ausblenden/ | |
*/ | |
remove_action ( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20); |
This file contains 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
/* | |
* WooCommerce - Produktzähler im Produktarchiv ausblenden | |
* | |
*/ | |
add_filter( 'woocommerce_subcategory_count_html', 'jk_hide_category_count' ); | |
function jk_hide_category_count() { | |
// Kein Zähler | |
} |
This file contains 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
/* | |
* WooCommerce - Produkt automatisch in den Warenkorb legen | |
* | |
*/ | |
// add item to cart on visit | |
add_action( 'template_redirect', 'add_product_to_cart' ); | |
function add_product_to_cart() { | |
if ( ! is_admin() ) { | |
$product_id = 64; | |
$found = false; |
This file contains 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
/* | |
* WooCommerce - Geschenk automatisch in den Warenkorb ab Mindestbestellwert | |
* | |
*/ | |
// add item to cart on visit depending on cart total value | |
add_action( 'init', 'add_product_to_cart' ); | |
function add_product_to_cart() { | |
if ( ! is_admin() ) { | |
global $woocommerce; | |
$product_id = 2831; |
This file contains 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
/* | |
* WooCommerce - Zahlungsart in Admin Email anzeigen | |
* | |
*/ | |
add_action( 'woocommerce_email_after_order_table', 'add_payment_method_to_admin_new_order', 15, 2 ); | |
function add_payment_method_to_admin_new_order( $order, $is_admin_email ) { | |
if ( $is_admin_email ) { | |
echo '<p><strong>Payment Method:</strong> ' . $order->payment_method_title . '</p>'; | |
} |
This file contains 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
/* | |
*WooCommerce - Direkt auf der Shop-Seite Anzahl der Produkte zum Kauf festlegen | |
* | |
*/ | |
<?php | |
/** | |
* Code should be placed in your theme functions.php file. | |
*/ | |
add_filter( 'woocommerce_loop_add_to_cart_link', 'quantity_inputs_for_woocommerce_loop_add_to_cart_link', 10, 2 ); | |
function quantity_inputs_for_woocommerce_loop_add_to_cart_link( $html, $product ) { |
This file contains 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
/* | |
* Anzahl der verkauften Produkte in der WooCommerce Produktbeschreibung anzeigen | |
* | |
*/ | |
add_action( 'woocommerce_single_product_summary', 'wc_product_sold_count', 11 ); | |
function wc_product_sold_count() { global $product; | |
$units_sold = get_post_meta( $product->id, 'total_sales', true ); | |
echo '<p>' . sprintf( __( 'Verkaufte Produkte: %s', 'woocommerce' ) | |
, $units_sold ) . '</p>'; } |