我需要在表格中的价格后删除-00,但例如应显示-50。 (我没有使用WooCommerce,这是我在搜索此问题时获得的大部分结果)
如果我尝试删除此位,则会立即将其更改回 example_price ,00€
答案 0 :(得分:0)
将以下示例代码添加到您的子主题的functions.php文件或特定于站点的插件中。
<?php
//* Do NOT include the opening php tag
//* Remove decimals from total calculation in Gravity Forms
function gf_update_currency( $currencies ) {
$currencies['USD'] = array(
'name' => __( 'U.S. Dollar', 'gravityforms' ),
'symbol_left' => '$',
'symbol_right' => '',
'symbol_padding' => '',
'thousand_separator' => ',',
'decimal_separator' => '.',
'decimals' => 0
);
return $currencies;
}
add_filter( 'gform_currencies', 'gf_update_currency' );