• Sami S

    (@sami-sanpakkila)


    Hi,

    Using DHL plugin in Finland and trying to ship a package to Italy in the state of Monza E Della Brianza.

    I get this error: Destination state can have between 2 and 20 characters.

    The state that Woocommerce automatically offers ant that can’t be changed is Monza E Della Brianza.

    Can you advice how to fix this?

Viewing 1 replies (of 1 total)
  • Plugin Author Abdalsalaam Halawa

    (@abdalsalaam)

    Hi @sami-sanpakkila
    you can edit it using “” hoo, for example :

    add_filter('pr_shipping_dhl_label_args', 'modify_shipping_address_state', 10, 2);
    	
    	function modify_shipping_address_state($args, $order_id) {
    		if ( 'Monza E Della Brianza' == $args['shipping_address']['state'] ) {
    			$args['shipping_address']['state'] = 'MB';
    		}
    		
    		return $args;
    	}

    Please replace “MB” with the state name abbreviation, check it with DHL support to make sure you write the right name.

Viewing 1 replies (of 1 total)
  • The topic ‘Destination state with too many characters’ is closed to new replies.