Geekdeck Posted July 18, 2013 Share Posted July 18, 2013 Hi, I cant seem to figure out how to add to the address requirements in country settings. Currently I have City as a required field. I would like to change the name to City/Suburb. How do we add a new item in the list on the right to be added to the required address fields? Any help would be appreciated. Thanks. Link to comment Share on other sites More sharing options...
vekia Posted July 18, 2013 Share Posted July 18, 2013 hello go to Address class located in the classes/Address.php file you've got there Address object definition: /** * @see ObjectModel::$definition */ public static $definition = array( 'table' => 'address', 'primary' => 'id_address', 'fields' => array( 'id_customer' => array('type' => self::TYPE_INT, 'validate' => 'isNullOrUnsignedId', 'copy_post' => false), 'id_manufacturer' => array('type' => self::TYPE_INT, 'validate' => 'isNullOrUnsignedId', 'copy_post' => false), 'id_supplier' => array('type' => self::TYPE_INT, 'validate' => 'isNullOrUnsignedId', 'copy_post' => false), 'id_warehouse' => array('type' => self::TYPE_INT, 'validate' => 'isNullOrUnsignedId', 'copy_post' => false), 'id_country' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true), 'id_state' => array('type' => self::TYPE_INT, 'validate' => 'isNullOrUnsignedId'), 'alias' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'required' => true, 'size' => 32), 'company' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'size' => 64), 'lastname' => array('type' => self::TYPE_STRING, 'validate' => 'isName', 'required' => true, 'size' => 32), 'firstname' => array('type' => self::TYPE_STRING, 'validate' => 'isName', 'required' => true, 'size' => 32), 'vat_number' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'), 'address1' => array('type' => self::TYPE_STRING, 'validate' => 'isAddress', 'required' => true, 'size' => 128), 'address2' => array('type' => self::TYPE_STRING, 'validate' => 'isAddress', 'size' => 128), 'postcode' => array('type' => self::TYPE_STRING, 'validate' => 'isPostCode', 'size' => 12), 'city' => array('type' => self::TYPE_STRING, 'validate' => 'isCityName', 'required' => true, 'size' => 64), 'other' => array('type' => self::TYPE_STRING, 'validate' => 'isMessage', 'size' => 300), 'phone' => array('type' => self::TYPE_STRING, 'validate' => 'isPhoneNumber', 'size' => 32), 'phone_mobile' => array('type' => self::TYPE_STRING, 'validate' => 'isPhoneNumber', 'size' => 32), 'dni' => array('type' => self::TYPE_STRING, 'validate' => 'isDniLite', 'size' => 16), 'deleted' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'copy_post' => false), 'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDateFormat', 'copy_post' => false), 'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDateFormat', 'copy_post' => false), ), ); required field has got 'required' => true param Link to comment Share on other sites More sharing options...
Geekdeck Posted July 18, 2013 Author Share Posted July 18, 2013 hello go to Address class located in the classes/Address.php file you've got there Address object definition: /** * @see ObjectModel::$definition */ public static $definition = array( 'table' => 'address', 'primary' => 'id_address', 'fields' => array( 'id_customer' => array('type' => self::TYPE_INT, 'validate' => 'isNullOrUnsignedId', 'copy_post' => false), 'id_manufacturer' => array('type' => self::TYPE_INT, 'validate' => 'isNullOrUnsignedId', 'copy_post' => false), 'id_supplier' => array('type' => self::TYPE_INT, 'validate' => 'isNullOrUnsignedId', 'copy_post' => false), 'id_warehouse' => array('type' => self::TYPE_INT, 'validate' => 'isNullOrUnsignedId', 'copy_post' => false), 'id_country' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true), 'id_state' => array('type' => self::TYPE_INT, 'validate' => 'isNullOrUnsignedId'), 'alias' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'required' => true, 'size' => 32), 'company' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'size' => 64), 'lastname' => array('type' => self::TYPE_STRING, 'validate' => 'isName', 'required' => true, 'size' => 32), 'firstname' => array('type' => self::TYPE_STRING, 'validate' => 'isName', 'required' => true, 'size' => 32), 'vat_number' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'), 'address1' => array('type' => self::TYPE_STRING, 'validate' => 'isAddress', 'required' => true, 'size' => 128), 'address2' => array('type' => self::TYPE_STRING, 'validate' => 'isAddress', 'size' => 128), 'postcode' => array('type' => self::TYPE_STRING, 'validate' => 'isPostCode', 'size' => 12), 'city' => array('type' => self::TYPE_STRING, 'validate' => 'isCityName', 'required' => true, 'size' => 64), 'other' => array('type' => self::TYPE_STRING, 'validate' => 'isMessage', 'size' => 300), 'phone' => array('type' => self::TYPE_STRING, 'validate' => 'isPhoneNumber', 'size' => 32), 'phone_mobile' => array('type' => self::TYPE_STRING, 'validate' => 'isPhoneNumber', 'size' => 32), 'dni' => array('type' => self::TYPE_STRING, 'validate' => 'isDniLite', 'size' => 16), 'deleted' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'copy_post' => false), 'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDateFormat', 'copy_post' => false), 'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDateFormat', 'copy_post' => false), ), ); required field has got 'required' => true param Thanks for the input. This will change which field is required or not. Thanks for that. However my main issue is changing the name of City to City/Suburb. Any idea how to change the name? Link to comment Share on other sites More sharing options...
vekia Posted July 18, 2013 Share Posted July 18, 2013 You can translate it with default prestashop translation tool located under the localization > translation tab in your back office Link to comment Share on other sites More sharing options...
Geekdeck Posted July 18, 2013 Author Share Posted July 18, 2013 You can translate it with default prestashop translation tool located under the localization > translation tab in your back office Hi, Thanks for that. Gave it a go and I thought I went smoothly... had a look at the site and now menu items don't work.... Now I am stressing. What have I done? They say the page is no longer available. Link to comment Share on other sites More sharing options...
vekia Posted July 18, 2013 Share Posted July 18, 2013 what you mean exactly? you've got 404 error? it is possible to test your website? it is online? Link to comment Share on other sites More sharing options...
Geekdeck Posted July 18, 2013 Author Share Posted July 18, 2013 what you mean exactly? you've got 404 error? it is possible to test your website? it is online? No, the site displays a page saying "Page not available". The site is at www.trailmax.com.au. If you now click any top menu items or bottom "my account" menu items it has the issue. Link to comment Share on other sites More sharing options...
vekia Posted July 18, 2013 Share Posted July 18, 2013 it's probably related to the friednly urls you turned it on, am i right? please regenerate the prestashop's htaccess file Link to comment Share on other sites More sharing options...
Geekdeck Posted July 18, 2013 Author Share Posted July 18, 2013 it's probably related to the friednly urls you turned it on, am i right? please regenerate the prestashop's htaccess file Thanks, your the best! That fixed it. Strange however as I did not touch the friendly urls for several weeks. I have however installed a payment gateway module. Could this have done it? Link to comment Share on other sites More sharing options...
vekia Posted July 18, 2013 Share Posted July 18, 2013 yes, sometimes after changes in the back office is necessary to regenerate the htaccess file, especially when you use non-default and external solutions im glad that it works for you as you expect, can i mark this thread as [solved] ? Link to comment Share on other sites More sharing options...
Geekdeck Posted July 18, 2013 Author Share Posted July 18, 2013 yes, sometimes after changes in the back office is necessary to regenerate the htaccess file, especially when you use non-default and external solutions im glad that it works for you as you expect, can i mark this thread as [solved] ? The link fixed however not the text. I changed it in field name translations but this did not change it. Link to comment Share on other sites More sharing options...
vekia Posted July 18, 2013 Share Posted July 18, 2013 you use this: + ? Link to comment Share on other sites More sharing options...
Geekdeck Posted July 18, 2013 Author Share Posted July 18, 2013 you use this: + ? Yes that's what I did but no luck. When you look at the field where you add or create an address it still just states city. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now