Hide Add to Cart Button

Just add the following code in your functions.php and you will find button hidden I don’t know whether my solution is perfect. But it works. Normally if is_purchasable is returned to the filter woocommerce_is_purchasable, the ‘Add to Cart’ button is displayed, and if false is returned the button is hidden. So, you just need to … Read more

Shortcode with product catgory counter

Try this: (add it to the theme’s main functions.php file) add_shortcode( ‘products-counter’, ‘products_counter’ ); function products_counter( $atts ) { $atts = shortcode_atts( [ ‘category’ => ”, ], $atts ); $taxonomy = ‘product_cat’; if ( is_numeric( $atts[‘category’] ) ) { $cat = get_term( $atts[‘category’], $taxonomy ); } else { $cat = get_term_by( ‘slug’, $atts[‘category’], $taxonomy ); … Read more

Show attribute description when filtering by that attribute

You need to check when filter is enabled and take selected attribute taxonomy, ‘pa_brand’ in this case: add_action( ‘woocommerce_before_shop_loop’, ‘desc_before’, 75 ); function desc_before() { if (is_filtered()) { $brands = WC_Query::get_layered_nav_chosen_attributes() [‘pa_brand’]; if ( isset($brands) ) { foreach ($brands[‘terms’] as $term ) { $term_obj = get_term_by(‘slug’, $term, ‘pa_brand’); echo ‘<div class=”ka-attr-description”>’. ‘<h4>’ . $term_obj ->name … Read more

Woocommerce add custom button to backend order table

@mmm thanks for that code, I didnt know this filter yet. Do you know if it is also possible to add a tooltip that way? Anyway, I have a different solution to add a new button to this column, and also want to post it: add_action( ‘woocommerce_admin_order_actions_end’, ‘add_content_to_wcactions_column’ ); function add_content_to_wcactions_column() { // create some … Read more