Author Topic: address format???  (Read 4796 times)

Offline smallfish

  • Full Member
  • ***
  • Posts: 129
  • Karma: +15/-2
    • View Profile
address format???
« on: March 22, 2013, 04:31:48 AM »
Can abantecart modify the address format in "country" at the backend admin?
I have tried removed the "city" and "postcode" but the frontend store still needs me to input the city and postcode.
How to solve it?
Thank you!

First Name = {firstname}
Last Name = {lastname}
Company = {company}
Address 1 = {address_1}
Address 2 = {address_2}
City = {city} <--- delete
Postcode = {postcode} <--- delete
Zone = {zone}
Zone Code = {zone_code}
Country = {country}

Offline smallfish

  • Full Member
  • ***
  • Posts: 129
  • Karma: +15/-2
    • View Profile
Re: address format???
« Reply #1 on: March 30, 2013, 01:47:18 AM »
It seems that abantecart doesn't implement this feature right now. Please fix it.
Thank you!

Offline abantecart

  • Administrator
  • Hero Member
  • *****
  • Posts: 4152
  • Karma: +251/-9
    • View Profile
    • Ideal Open Source Ecommerce Solution
Re: address format???
« Reply #2 on: March 30, 2013, 08:30:09 AM »
Yes, you can do this.
Go System ->Localization -> Countries.
Select country and add the format.
We need your help to build better free open source eCommerce platform for everyone.
See how you can help

Offline smallfish

  • Full Member
  • ***
  • Posts: 129
  • Karma: +15/-2
    • View Profile
Re: address format???
« Reply #3 on: March 30, 2013, 10:09:53 PM »
But it doesn't work. There is no effect after I have added the format. I open the registered page and change address at checkout page, it still needs me to input postcode and city. Please check it and fix it.
Thank you!

Yes, you can do this.
Go System ->Localization -> Countries.
Select country and add the format.

Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 1781
  • Karma: +247/-11
  • web for all, all for web!
    • View Profile
    • AbanteCart
Re: address format???
« Reply #4 on: April 01, 2013, 06:43:11 AM »
Data of new account form validates in file
public_html/storefront/model/account/customer.php method validateRegistrationData, line #174

you can remove check for city
Code: [Select]
if ((strlen(utf8_decode($data['city'])) < 3) || (strlen(utf8_decode($data['city'])) > 128)) {
$error['city'] = $this->language->get('error_city');
}
or just comment.
Also you can open file public_html/storefront/controller/pages/account/create.php
and change 'required' => true  by 'required' => false
Code: [Select]
$this->data['form'][ 'city' ] = $form->getFieldHtml( array(
                                            'type' => 'input',
                                            'name' => 'city',
                                            'value' => $this->request->post['city'],
                                           'required' => true ));



“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

Offline smallfish

  • Full Member
  • ***
  • Posts: 129
  • Karma: +15/-2
    • View Profile
Re: address format???
« Reply #5 on: April 01, 2013, 11:43:19 AM »
Athough the following modification can solve it. But my customers also came from various countries.
So that I still need it to check the city and postcode. The best solution should allow me to modify the address format in backend for each countries and abantecart should check the format for each countries at frontend. The original design should allow to modify the address format for each countries but abantecart do not implment it. Hope the fix can be  released in the coming new version.
Thank.

Data of new account form validates in file
public_html/storefront/model/account/customer.php method validateRegistrationData, line #174

you can remove check for city
Code: [Select]
if ((strlen(utf8_decode($data['city'])) < 3) || (strlen(utf8_decode($data['city'])) > 128)) {
$error['city'] = $this->language->get('error_city');
}
or just comment.
Also you can open file public_html/storefront/controller/pages/account/create.php
and change 'required' => true  by 'required' => false
Code: [Select]
$this->data['form'][ 'city' ] = $form->getFieldHtml( array(
                                            'type' => 'input',
                                            'name' => 'city',
                                            'value' => $this->request->post['city'],
                                           'required' => true ));

Offline Kia

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: address format???
« Reply #6 on: April 27, 2015, 05:08:53 AM »
first of all sorry for bringing this old post back to life again but I got a series of question. I've been searching for a way to remove address from registration in my previous CMS without any luck (since I'm selling only downloadable goods) and I guess I'll convert to AbanteCart now.
I've tried the last way "'required' => false" and event tough required star where removed, when I click continue the usual errors came up when I left those fields empty. ofc adding the first way and removing check fixed that.
Now my fist two question is: can I remove all addresses from registration without facing any problem in core functions? and where I can find the file to rearrange the register page and remove address fields?
next question is: what about guest checkout?

 

Powered by SMFPacks Social Login Mod