get woocommerce product image url and price from database [closed]

The only way I see is to use nested WHERE clause: SELECT p.*, pm2.meta_value as image_file FROM ( SELECT p.ID, p.post_title, `post_content`, `post_excerpt`, t.name AS product_category, t.term_id AS product_id, t.slug AS product_slug, tt.term_taxonomy_id AS tt_term_taxonomia, tr.term_taxonomy_id AS tr_term_taxonomia, MAX(CASE WHEN pm1.meta_key = ‘_price’ then pm1.meta_value ELSE NULL END) as price, MAX(CASE WHEN pm1.meta_key = ‘_sku’ … Read more

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