我使用这个插件:https://wordpress.org/plugins/aramex-shipping-woocommerce/
但是我尝试了所有的方法,但是我不能解决这个问题。我有活动的所有详细信息的Aramex帐户,我在woocommerce设置设置插件,但在点击查看购物车显示Aramex: ERR52 -目的地我的城市和地址是无效的,而我作为一个客人开始购物。另外,是否可以禁用邮政编码,同时使用Aramex?请任何知道是什么原因的人
发布于 2020-08-11 05:16:26
邮政编码要求基于每个国家,例如: GCC国家不需要邮政编码,而大多数其他国家需要邮政编码。
发布于 2020-08-11 07:17:15
您可以通过向主题的functions.php添加过滤器,让WooCommerce覆盖使该字段成为必填字段的默认设置。最好的做法是使用create a child theme,这样它就不会在每次更新主题时被覆盖。
例如,此代码将在结帐期间从账单和发货邮政编码中删除“必需”状态(如果发货国家/地区不是“美国”):
add_filter( 'woocommerce_checkout_fields','custom_override_default_address_fields' );
function custom_override_default_address_fields($fields){
global $woocommerce;
$country = $woocommerce->customer->get_shipping_country();
if($country !== 'US'){
$fields['billing']['billing_postcode']['required'] = false;
$fields['shipping']['shipping_postcode']['required'] = false;
}
return $fields;
}有关可通过过滤进行编辑的过滤器和字段的更多详细信息,请参阅WooCommerce Customizing checkout fields using actions and filters doc
https://stackoverflow.com/questions/61896219
复制相似问题