WooCommerce Cart Notices
-
Hallo zusammen
Ich möchte die Cart Notices nur auf spezifischen Seiten mit den Shortcodes anzeigen, d.h. auf der Cart & Checkout Seite entfernen. Für die Checkout Seite habe ich folgenden Code gefunden, mit dem die Cart Notices erfolgreich entfernt sind. Für die Cart Seite habe ich versucht den Code umzuschreiben, aber es funktioniert nicht… weiss jemand wo der Fehler ist?
Mein umgeschriebener Code um die Cart Notices vom Cart zu entfernen (funktioniert nicht)
function sv_remove_cart_notice_on_cart() { if ( function_exists( 'wc_cart_notices' ) ) { remove_action( 'woocommerce_before_cart_form', array( wc_cart_notices(), 'add_cart_notice' ) ); } } add_action( 'init', 'sv_remove_cart_notice_on_cart' );
——————-
Ursprünglicher Code – Dieser entfernt die Cart Notices erfolgreich von der Checkout Page
// Removes cart notices from the checkout page function sv_remove_cart_notice_on_checkout() { if ( function_exists( 'wc_cart_notices' ) ) { remove_action( 'woocommerce_before_checkout_form', array( wc_cart_notices(), 'add_cart_notice' ) ); } } add_action( 'init', 'sv_remove_cart_notice_on_checkout' );
Ansicht von 1 Antwort (von insgesamt 1)
Ansicht von 1 Antwort (von insgesamt 1)
- Das Thema „WooCommerce Cart Notices“ ist für neue Antworten geschlossen.