Remove Address Formatting



  • Is there a way to stop thirty bees altering the addresses when orders come in from marketplaces?

    We get quite a lot of people, on Amazon in particular, who put the first line of their address in the name field by mistake. Because you are not allowed numbers in the name field, thirty bees removes these and we end up sending out the parcel without the house number so the delivery company has no idea where to deliver it to. The parcels then end up back with us.

    Sometimes people also put special characters in the address like a slash or hashtag which also seem to get removed.

    Basically, is there any way of stopping the addresses being changed at all when orders are imported into thirty bees?





  • Thanks, I’ll have a play



  • @spidawebs You could allow numbers in the name field by altering classes/Validate.php

    If you look for this part

        /**
         * Check for name validity
         *
         * @param string $name Name to validate
         *
         * @return bool Validity is ok or not
         *
         * @since   1.0.0
         * @version 1.0.0 Initial version
         */
        public static function isName($name)
        {
        
    return (bool) preg_match(Tools::cleanNonUnicodeSupport('/^[^0-9!<>,;?=+()@#"°{}_$%:]*$/u'), stripslashes($name));
    
        }
    

    just remove 0-9 from the characters that are not allowed so that the line inside the function reads

    return (bool) preg_match(Tools::cleanNonUnicodeSupport('/^[^!<>,;?=+()@#"°{}_$%:]*$/u'), stripslashes($name));


  • It would be nice if this were to flow into the core.



  • @marci123 Thanks for your suggestion. I implemented this last week, but since I made the change it broke the API link to the despatch company we use to print our shipping labels and dispatch the orders. None of the orders were being marked as despatched in Prestashop.

    So I had to put it back to how it was and now it is working again.

    I have no idea why removing 0-9 should have this knock on effect, but is there any other way I can solve this problem without it causing other things to break?


Log in to reply
 

Looks like your connection to thirty bees forum was lost, please wait while we try to reconnect.