在WordPress/WooCommerce中将税收更改为GST

Sam*_*ant 3 php wordpress woocommerce

将税改为商品及服务税

我无法更改网站上购物车页面中的措辞.由于我的商店在澳大利亚,我想将命名惯例从Tax更改为GST.我更改了语言文件(/wp-content/plugins/woocommerce/i18n/languages/woocommerce.pot),但它根本没有影响我的商店.

有没有人有另一种改变购物车页面内措辞的方法?我可以在/ wp-content/themes/mytheme/woocommerce /中编辑任何PHP文件吗?

som*_*som 8

有可用的过滤器.将它们包含在主题的functions.php文件中:

/wp-content/themes/mytheme/functions.php

add_filter( 'woocommerce_countries_inc_tax_or_vat', function () {
  return __( '(incl. GST)', 'woocommerce' );
});
Run Code Online (Sandbox Code Playgroud)

WooCommerce 2.3.8,PHP 5.3+

另见:woocommerce_countries_tax_or_vat&woocommerce_countries_ex_tax_or_vat

过滤器和操作用于修改和扩展核心功能(无需编辑可能被更新覆盖的任何内容).

查看WooCommerce文档.他们带着这种东西去城里.