Last active
December 19, 2017 11:17
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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