我想删除Woocommerce设置的所有国家。有人可以告诉我在哪里可以看到/修改由woocommerce设置的国家列表吗?我已经在woocommerce中查看了class-c-countries.php
,我很确定这种方法public function get_countries()
获取国家/地区列表,但似乎它通过使用woocommerce_countries
来获取它们,所以我无法真正编辑它。而且我似乎无法访问该列表/文件。
这是方法:
public function get_countries() {
if ( empty( $this->countries ) ) {
$this->countries = apply_filters( 'woocommerce_countries', include( WC()->plugin_path() . '/i18n/countries.php' ) );
if ( apply_filters( 'woocommerce_sort_countries', true ) ) {
asort( $this->countries );
}
}
return $this->countries;
}
如果需要,我可以发布整个.php
文件,请告诉我。提前感谢您的帮助!
顺便说一句,我对php
了解不多。
您可以在Woocommerce设置中更改此设置,无需PHP。将"销售地点"设置为"特定国家/地区",并仅选择要在结账时显示的国家/地区。请参阅Woocommerce文档:https://docs.woothemes.com/document/configuring-woocommerce-settings/