How can i style “echo apply_filters”

apply_filters just calls any methods hooked to the filter, in this case woocommerce_attribute, and returns the output. You could do a couple of things to style this, here’s one way: $filtered = apply_filters( ‘woocommerce_attribute’, wpautop( wptexturize( implode( ‘, ‘, $values ) ) ), $attribute, $values ); echo ‘<span class=”attribute-‘ . esc_attr( $attribute ) . “>’ … Read more

WooCommerce Tax Filter Not Working

You should get the subtotal like this: global $woocommerce; $cart_subtotal = $woocommerce->cart->get_cart_subtotal(); From here. So you will can do something like this: add_filter( ‘woocommerce_product_tax_class’, ‘big_apple_get_tax_class’, 1, 2 ); function big_apple_get_tax_class( $tax_class, $product ) { global $woocommerce; $cart_subtotal = $woocommerce->cart->get_cart_subtotal(); if ( $cart_subtotal <= 110 ) $tax_class=”Zero Rate”; return $tax_class; }

how to show product custom taxonomies in woocommerce rest api

I eventually found a way using filters. I didn’t know there were filters for REST API responses… Here is my solution : add_filter( ‘woocommerce_rest_prepare_product’, ‘custom_products_api_data’, 90, 2 ); function custom_products_api_data( $response, $post ) { // retrieve a custom field and add it to API response $response->data[‘custom_taxonomy1’] = wp_get_post_terms( $post->ID, ‘custom_taxonomy1’, [] ); $response->data[‘custom_taxonomy2’] = wp_get_post_terms( … Read more

Woocommerce price in meta data

You can try the following filters available in Yoast WordPress SEO: apply_filters( ‘wpseo_twitter_metatag_key’, ‘name’ ); Source: wpseo_twitter_metatag_key apply_filters( ‘wpseo_og_’ . $og_property, $content ); Source: wpseo_og_’ . $og_property EDIT – Review after seeing the product URL Yoast SEO is not generating the Twitter/FB meta tags. Open Graph for Facebook, Google+ and Twitter Card Tags plugin is … Read more