remove add to cart for free (0 $) product woocommerce

Please try to add following code into your theme functions.php file function remove_add_to_cart_option( $purchasable, $product ){ if( $product->get_price() == 0 ) $purchasable = false; return $purchasable; } add_filter( ‘woocommerce_is_purchasable’, ‘remove_add_to_cart_option’, 10, 2 ); Replace below function instead of above and check again /* * Override via functions.php **/ if (!function_exists(‘woocommerce_template_loop_add_to_cart’)) { function woocommerce_template_loop_add_to_cart() { global … Read more

Woocommerce – Default product image by user role

/** * Only allowing the customer and admin user role to view the product images * * @param $value * * @return bool */ function woocommerce_product_get_image_id_callback( $value ) { global $current_user; if ( in_array( ‘customer’, (array) $current_user->roles ) || in_array( ‘administrator’, (array) $current_user->roles ) ) { return $value; } else { return false; } } … Read more

Remove filter parameter from Link URL

You can set a canonical URL: <link rel=”canonical” href=”https://www.amaoni.de/shop/hundebetten” /> which will tell search engines that those pages are copies of each other (just with different filters). You can also tell Google, via Webmaster tools, which URL parameters to ignore (your filters). See this Help Centre article: https://support.google.com/webmasters/answer/6080548?hl=en

How to apply a custom coupon to a WooCommerce Subscription recurring amount?

I have managed to find a way, but welcome a better one. As mentioned in the OP comments, the function remove_coupons() in class WC_Subscriptions_Coupon in file woocommerce-subscriptions/includes/class-wc-subscriptions-coupon.php is removing coupons that are not ‘recurring_fee’ or ‘recurring_percent’. There is no filter added we can tap into to assign our own custom coupon types, so there does … Read more