Skip to content

Instantly share code, notes, and snippets.

@finalwebsites
Last active April 15, 2023 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save finalwebsites/e1faf0f0b6260ae6adfcf1045706a0ad to your computer and use it in GitHub Desktop.
Save finalwebsites/e1faf0f0b6260ae6adfcf1045706a0ad to your computer and use it in GitHub Desktop.
WooCommerce hooks example codes
<?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 );
<?php
// remove image from the shopping cart
add_filter( 'woocommerce_cart_item_thumbnail', '__return_false' );
<?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