Created
August 6, 2026 16:48
-
-
Save LPerderiset/96eceb89f34e07db2adb6c4c57e91d90 to your computer and use it in GitHub Desktop.
Supprimer le bouton "Ajouter au panier" sur la page produit et ajouter un bouton de contact
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
| // Supprimer le bouton "Ajouter au panier" sur la page produit et ajouter un bouton de contact | |
| remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30); | |
| add_action('woocommerce_single_product_summary', 'custom_contact_button_single', 30); | |
| function custom_contact_button_single() { | |
| $contact_page_url = get_permalink( get_page_by_path( 'contact' ) ); // ici le slug de la page de contact est "contact" modifiez-le avec votre slug | |
| echo '<a href="' . esc_url($contact_page_url) . '" class="button contact-button">' . __('Contactez-nous', 'woocommerce') . '</a>'; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment