Last active
June 13, 2022 19:43
-
-
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.
This file contains 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
<?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 ); |
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
This code is apparently not working anymore