Skip to content

Instantly share code, notes, and snippets.

@Auke1810
Last active March 8, 2022 05:48
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/ae4363b10681af252a02f9c0aafcec30 to your computer and use it in GitHub Desktop.
Save Auke1810/ae4363b10681af252a02f9c0aafcec30 to your computer and use it in GitHub Desktop.
In this example we changed the price attribute and rounded the price with the round() function.
<?php
// Round the price
function round_price( $data, $feed_id, $product_id ) {
// round price.
$round_price = round($data['price'], 2);
// Store the rounded price in the feed price element.
$data['price'] = $round_price;
// Always return data!
return $data;
}
add_filter( 'wppfm_feed_item_value', 'round_price', 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment