Skip to content

Instantly share code, notes, and snippets.

@Auke1810
Last active December 19, 2017 11:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Auke1810/3517e1c5a19f372ca2a4bcf3eda8b3d7 to your computer and use it in GitHub Desktop.
Save Auke1810/3517e1c5a19f372ca2a4bcf3eda8b3d7 to your computer and use it in GitHub Desktop.
Use the price including tax in the price attribute for the woocommerce product feed manager
/**
* Alter Product feed item
* Use the price including tax in the price attribute
*/
function alter_feed_item( $attributes, $feed_id, $product_id ) {
global $product;
$product = wc_get_product( $product_id );
// show price including tax
$attributes['price'] = $product->get_price_including_tax() . " USD";
// IMPORTANT! Always return the $attributes
return $attributes;
}
add_filter( 'wppfm_feed_item_value', 'alter_feed_item', 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment