skip to Main Content

I use this plugin: https://wordpress.org/plugins/aramex-shipping-woocommerce/

But I try any means but I failed to solve the issue . I have active Aramex account with all details, I setup plugin in woocommerce settings, but after click view cart show Aramex: ERR52 – Destination my city and address are invalid while I start shop as a guest. Also is it possible to disable ZIP code while use Aramex? Please any one with idea what cause this

2

Answers


  1. the zipcode requirements are based on each country , for eg: GCC countries do not need zip code and most other countries need zipcode.

    Login or Signup to reply.
  2. You can have WooCommerce override the default setting that makes the field required by adding a filter to your theme’s functions.php. It would be best practice is to create a child theme so it won’t get overwritten each time you update the theme.

    For example, this code will remove the "required" state from the billing and shipping postal codes during checkout (if the shipping country is not ‘US’):

    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;
    }
    

    For more details on filters and fields available to edit via filtering see WooCommerce Customizing checkout fields using actions and filters doc

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search