Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Auke1810/bbb419c09057dddf13262f069295663f to your computer and use it in GitHub Desktop.
Save Auke1810/bbb419c09057dddf13262f069295663f to your computer and use it in GitHub Desktop.
remove the thousand seperator from the price item in a feed created with wp product feed manager.
<?php
function alter_feed_price_item_remove_thousand_seperator( $attributes, $feed_id, $product_id ) {
global $product;
$product = wc_get_product( $product_id );
$product_price = $attributes['price'];
// show price without thousand separator and . as decimal separator
$attributes['price'] = number_format( $product_price, 2, '.', '') . " EUR";
// price will look like 1234.57
// IMPORTANT! Always return the $attributes
return $attributes;
}
add_filter( 'wppfm_feed_item_value', 'alter_feed_price_item_remove_thousand_seperator', 10, 3 );
@giac2007
Copy link

giac2007 commented Oct 13, 2018

This code is apparently not working anymore

@Auke1810
Copy link
Author

Auke1810 commented Mar 16, 2021

This code is apparently not working anymore

Hello Giax2007 checked the code and it is working fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment