How to give each category name its own ACF background color?

The syntax to get the ACF field of a custom taxonomy is: $var = get_field(‘name_of_acf_field’, ‘name_of_taxonomy’ . ‘_’ . taxonomy_ID); so in your case you’ll need to get product_cat ID before and do something like: add_action( ‘woocommerce_shop_loop_item_title’, ‘VS_woo_loop_product_title’, 10 ); function VS_woo_loop_product_title() { echo ‘<h3>’ . get_the_title() . ‘</h3>’; $terms = get_the_terms( $post->ID, ‘product_cat’ ); … Read more

WooCommerce plaintext mail doesn’t display currency symbol

Before a plain text email is sent in WooCommerce, all HTML tags and some HTML entities are stripped. Specifically, WooCommerce uses wp_strip_all_tags and preg_replace with a custom set of patterns and replacements to perform this operation. You can inspect the code in get_content in includes/emails/class-wc-emails.php. It appears that in this preg_replace operation, WooCommerce removes the … Read more

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