WooCommerce product title formatting

Add Brand as taxonomy: if ( ! function_exists( ‘brand_tax’ ) ) { // Register Custom Taxonomy function brand_tax() { $labels = array( ‘name’ => _x( ‘Brands’, ‘Taxonomy General Name’, ‘text_domain’ ), ‘singular_name’ => _x( ‘Brand’, ‘Taxonomy Singular Name’, ‘text_domain’ ), ‘menu_name’ => __( ‘Brands’, ‘text_domain’ ), ‘all_items’ => __( ‘All brands’, ‘text_domain’ ), ‘parent_item’ => … Read more

minimum order item for certain products exempting 2 other products (in bulk)

Try this one (replace $special_products = array( <id1>, <id2>, … ); with your list of product IDs): // Set a minimum number of products requirement before checking out add_action( ‘woocommerce_check_cart_items’, ‘spyr_set_min_num_products’ ); function spyr_set_min_num_products() { // Only run in the Cart or Checkout pages if( is_cart() || is_checkout() ) { // List of “special” products … Read more

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