Last active
April 15, 2023 14:25
-
-
Save finalwebsites/e1faf0f0b6260ae6adfcf1045706a0ad to your computer and use it in GitHub Desktop.
WooCommerce hooks example codes
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
<?php | |
// remove the category description above the product list | |
remove_action( 'woocommerce_archive_description', 'woocommerce_taxonomy_archive_description', 10 ); | |
// add the category description below the product list | |
add_action( 'woocommerce_after_shop_loop', 'woocommerce_taxonomy_archive_description', 100 ); |
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
<?php | |
// remove image from the shopping cart | |
add_filter( 'woocommerce_cart_item_thumbnail', '__return_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
<?php | |
// change add to cart cart button label | |
add_filter( 'woocommerce_product_add_to_cart_text', 'fws_custom_add_to_cart_text' ); | |
function fws_custom_add_to_cart_text() { | |
return __( 'In winkelwagen', 'woocommerce' ); // add your own text | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment