Jump to content

Prestashop VAT Number - save without spaces Question


ukbaz

Recommended Posts

Hi In Prestashop VAT number module when querying Vies The WebServiceCheck function uses         $vat_number = str_replace(' ', '', $vat_number); 

I want to ensure that when VAT number is saved in the customer Address table that it also removes any spaces . Is the AdminAddressesController the right place to edit code for this?

Thanks

Baz

	public static function WebServiceCheck($vat_number)
	{
		if (empty($vat_number))
			return array();
		$vat_number = str_replace(' ', '', $vat_number);
		$prefix = Tools::substr($vat_number, 0, 2);
		if (array_search($prefix, self::getPrefixIntracomVAT()) === false)
			return array(Tools::displayError('Invalid VAT number'));

		// ** ADDED EDK addition. Seems the site requires a user agent
		$options = array(
		  'http'=>array(
		    'method'=>"GET",
		    'header'=>"User-Agent: Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1667.0 Safari/537.36\r\n" // i.e. An iPad 
		  )
		);

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...