How to exclude a taxonomy from shop & search page wooCommerce?

This might help you with Shop page listing: https://docs.woocommerce.com/document/exclude-a-category-from-the-shop-page/ And for Search page, here is a snippet that might help: function exclude_services_category_products_from_search( $query ) { if ( is_search() && !is_admin() ) { $array_with_service_category_id = []; $tax_query = $query->get( ‘tax_query’ ) ?: []; $tax_query[] = [ ‘taxonomy’ => ‘product_cat’, ‘terms’ => $array_with_service_category_id, ‘field’ => ‘term_id’, ‘operator’ … Read more

Whitespace between product image and gallery on initial load of lightbox product page

Ok, so eventually managed to figure out that it was due to a couple of optimization plugins that were interfering with WooCommerce’s image slider: JetPack’s lazy loading and SG Optimizer. Deactivated SG Optimizer and added the following to my child theme’s functions.php: function is_lazyload_activated() { $condition = is_product(); if ($condition) { return false; } return … Read more

How to relocate paypal button gateway on checkout page in woocommerce

Have you tried this? E.g. the paypal button function name is woo_custom_paypal_button. Then add action like this into your function.php or specific plugin: add_action( ‘woocommerce_checkout_before_customer_details’, ‘woo_custom_paypal_button’ ); Or if there’s something that’s already displayed there, and you might want to remove it, first find the function name and then try like this: remove_action( ‘woocommerce_checkout_before_customer_details’, ‘woo_function_to_remove’ … Read more

CF7 Ajax isn’t working when called inside WooCommerce “woocommerce_before_add_to_cart_button” hook [closed]

I am not sure when the woocommerce_before_add_to_cart_button action fires in the request sequence, but it could be worth adding the following code to your functions.php to see if it loads the CF7 js script files, add_action(‘wp_enqueue_scripts’, ‘pre_register_cf7_files’); function pre_register_cf7_files(){ wp_register_style(‘contact-form-7’, wpcf7_plugin_url( ‘includes/css/styles.css’ ), array(), WPCF7_VERSION, ‘all’ ); wp_register_script( ‘contact-form-7’, wpcf7_plugin_url( ‘includes/js/scripts.js’ ), array( ‘jquery’ ), … Read more