Post by tandarts » Sat Mar 12, 2011 5:53 am

Hello.

I run a digital download site and have spent all evening to find a solution for my problem.

I want to remove fields from my register form and that is the total Your adress part
(from Compagny to the State part).

I do not need that info from my buyers because it will only scare them off.
Most of my buyers want a quick sale without all this extra fields to fill in.
I can find all this data also in the receipts I get from paypal if I need to.

Can anyone tell me what to do..
I have edit create.php and create.tpl but I keep getting errors.

the "not required" fields are no problem but I can not get the required fields removed without errors and bugs.

Thank you in advance !!

Newbie

Posts

Joined
Fri Oct 22, 2010 6:18 am

Post by inactiveaccount9912 » Sat Mar 12, 2011 9:34 am

After i deleted them from create.php and create.tpl , i went to catalog>model>account>customer.php and i deleted them from there too( on line 8 ).Now it seems to work , you should try it on a test shop. Respect!

Expert Member

Posts

Joined
Fri May 14, 2010 2:36 am

Post by tandarts » Sat Mar 12, 2011 9:53 pm

Thank you for the quick answer. I will try it right now !!

Newbie

Posts

Joined
Fri Oct 22, 2010 6:18 am

Post by tandarts » Sat Mar 12, 2011 10:16 pm

thank you so much. It worked.. !!

Up to the next challenge :)

Newbie

Posts

Joined
Fri Oct 22, 2010 6:18 am

Post by astier » Sun Mar 13, 2011 9:29 pm

After i deleted them from create.php and create.tpl , i went to catalog>model>account>customer.php and i deleted them from there too( on line 8 ).Now it seems to work , you should try it on a test shop. Respect!
Hi! I need to do exactly the same!
I see you say, after you deleted them. Could you ve more specific? What lines of code should I delete? Sorry, I don´t know too much about codes, so all I can do is look for a code and change it with other one (copy /paste), that´s all and I really need to do that!

thxs,

Astier

Newbie

Posts

Joined
Sun Mar 13, 2011 9:24 pm

Post by inactiveaccount9912 » Sun Mar 13, 2011 10:15 pm

I ment after I deleted the rows like country , adress and others from the tpl and the controller.
You should delete the lines of code you dont need anymore.
As an example in the tpl, to remove field company , delete

Code: Select all

<tr>
            <td><?php echo $entry_company; ?></td>
            <td><input type="text" name="company" value="<?php echo $company; ?>" /></td>
          </tr>

Expert Member

Posts

Joined
Fri May 14, 2010 2:36 am

Post by astier » Sun Mar 13, 2011 11:07 pm

Excuse my ignorance but to see if it is clear:
I should delete this kind of code from the create.tpl, the create.php or the customer.php? Sorry but I dont know what you mean with "deleted the rows..." (maybe a language isuue, english is not my first language)

thxs for your answer anyway!

Newbie

Posts

Joined
Sun Mar 13, 2011 9:24 pm

Post by inactiveaccount9912 » Mon Mar 14, 2011 12:54 am

If you want to delete all adress fields
In create.tpl delete code

Code: Select all

<b style="margin-bottom: 2px; display: block;"><?php echo $text_your_address; ?></b>
      <div style="background: #F7F7F7; border: 1px solid #DDDDDD; padding: 10px; margin-bottom: 10px;">
        <table>
          <tr>
            <td width="150"><?php echo $entry_company; ?></td>
            <td><input type="text" name="company" value="<?php echo $company; ?>" /></td>
          </tr>
          <tr>
            <td><span class="required">*</span> <?php echo $entry_address_1; ?></td>
            <td><input type="text" name="address_1" value="<?php echo $address_1; ?>" />
              <?php if ($error_address_1) { ?>
              <span class="error"><?php echo $error_address_1; ?></span>
              <?php } ?></td>
          </tr>
          <tr>
            <td><?php echo $entry_address_2; ?></td>
            <td><input type="text" name="address_2" value="<?php echo $address_2; ?>" /></td>
          </tr>
          <tr>
            <td><span class="required">*</span> <?php echo $entry_city; ?></td>
            <td><input type="text" name="city" value="<?php echo $city; ?>" />
              <?php if ($error_city) { ?>
              <span class="error"><?php echo $error_city; ?></span>
              <?php } ?></td>
          </tr>
          <tr>
            <td id="postcode"><?php echo $entry_postcode; ?></td>
            <td><input type="text" name="postcode" value="<?php echo $postcode; ?>" />
			  <?php if ($error_postcode) { ?>
              <span class="error"><?php echo $error_postcode; ?></span>
              <?php } ?></td>
          </tr>
          <tr>
            <td><span class="required">*</span> <?php echo $entry_country; ?></td>
            <td><select name="country_id" id="country_id" onchange="$('select[name=\'zone_id\']').load('index.php?route=account/create/zone&country_id=' + this.value + '&zone_id=<?php echo $zone_id; ?>'); $('#postcode').load('index.php?route=account/create/postcode&country_id=' + this.value);">
                <option value="FALSE"><?php echo $text_select; ?></option>
                <?php foreach ($countries as $country) { ?>
                <?php if ($country['country_id'] == $country_id) { ?>
                <option value="<?php echo $country['country_id']; ?>" selected="selected"><?php echo $country['name']; ?></option>
                <?php } else { ?>
                <option value="<?php echo $country['country_id']; ?>"><?php echo $country['name']; ?></option>
                <?php } ?>
                <?php } ?>
              </select>
              <?php if ($error_country) { ?>
              <span class="error"><?php echo $error_country; ?></span>
              <?php } ?></td>
          </tr>
          <tr>
            <td><span class="required">*</span> <?php echo $entry_zone; ?></td>
            <td><select name="zone_id">
              </select>
              <?php if ($error_zone) { ?>
              <span class="error"><?php echo $error_zone; ?></span>
              <?php } ?></td>
          </tr>
        </table>
      </div>
In create.php delete

Code: Select all

if ((strlen(utf8_decode($this->request->post['address_1'])) < 3) || (strlen(utf8_decode($this->request->post['address_1'])) > 128)) {
      		$this->error['address_1'] = $this->language->get('error_address_1');
    	}

    	if ((strlen(utf8_decode($this->request->post['city'])) < 3) || (strlen(utf8_decode($this->request->post['city'])) > 128)) {
      		$this->error['city'] = $this->language->get('error_city');
    	}
		
		$this->load->model('localisation/country');
		
		$country_info = $this->model_localisation_country->getCountry($this->request->post['country_id']);
		
		if ($country_info && $country_info['postcode_required']) {
			if ((strlen(utf8_decode($this->request->post['postcode'])) < 2) || (strlen(utf8_decode($this->request->post['postcode'])) > 10)) {
				$this->error['postcode'] = $this->language->get('error_postcode');
			}
		}
			
    	if ($this->request->post['country_id'] == 'FALSE') {
      		$this->error['country'] = $this->language->get('error_country');
    	}
		
    	if ($this->request->post['zone_id'] == 'FALSE') {
      		$this->error['zone'] = $this->language->get('error_zone');
    	}

In catalog/model/account/customer.php on line 8 delete

Code: Select all

, address_1 = '" . $this->db->escape($data['address_1']) . "', address_2 = '" . $this->db->escape($data['address_2']) . "', city = '" . $this->db->escape($data['city']) . "', postcode = '" . $this->db->escape($data['postcode']) . "', country_id = '" . (int)$data['country_id'] . "', zone_id = '" . (int)$data['zone_id'] . "'
Hope it works for you too , for us it did! ;)

Expert Member

Posts

Joined
Fri May 14, 2010 2:36 am

Post by astier » Mon Mar 14, 2011 6:02 am

thanks alot!!
I am trying, first attempt on test site: failed :crazy:
Going for second attempt!! ;D


thanks!!!!!!!!!!

Newbie

Posts

Joined
Sun Mar 13, 2011 9:24 pm

Post by astier » Mon Mar 14, 2011 6:36 am

I am almost there!
but I have one problem and maybe you can help me!!
I delete exactly the code lines you told me to and everything looks fine, no address fields there.
BUT, when I register a user it displays an error code.
One thing that caugth my attention is that in the customer php code, in the place where I delete the lines you told me to it ends with this
$this->db->escape($data['company']) . "'[here it was the code I deleted]");
without my text:

Code: Select all

$this->db->escape($data['company']) . "'");
maybe some of those quote marks should be deleted too?

this is the error log it displays

Code: Select all

Notice: Undefined index: company in /home/hosting-account/domains/test-store-domain/public_html/catalog/model/account/customer.php on line 7Notice: Undefined index: address_1 in /home/hosting-account/domains/test-store-domain/public_html/catalog/model/account/customer.php on line 8Notice: Undefined index: address_2 in /home/hosting-account/domains/test-store-domain/public_html/catalog/model/account/customer.php on line 9Notice: Undefined index: city in /home/hosting-account/domains/test-store-domain/public_html/catalog/model/account/customer.php on line 10Notice: Undefined index: postcode in /home/hosting-account/domains/test-store-domain/public_html/catalog/model/account/customer.php on line 11Warning: Cannot modify header information - headers already sent by (output started at /home/hosting-account/domains/test-store-domain/public_html/index.php:92) in /home/hosting-account/domains/test-store-domain/public_html/system/engine/controller.php on line 27
thnaks again, I hope you know what I did wrong!

Newbie

Posts

Joined
Sun Mar 13, 2011 9:24 pm

Post by inactiveaccount9912 » Mon Mar 14, 2011 12:53 pm

I think you have not deleted all the code from customer.php , if you delete all fields from the adress like in the example above , you will have to delete those entries from customer.php.

Expert Member

Posts

Joined
Fri May 14, 2010 2:36 am

Post by DMJY » Mon Mar 14, 2011 3:12 pm

it is must the admiminstator 's responbility,we have no rights.

Buy Maplestory Mesos Cheap Maplestory Mesos Buy RS Gold Runescape Gold


Newbie

Posts

Joined
Mon Mar 14, 2011 11:26 am

Post by astier » Mon Mar 14, 2011 11:34 pm

Done!!!!!!!
This is what it was missing to delete in catalog/model/account/customer.php
$data['company'] = ucwords(strtolower(trim($data['company'])));
$data['address_1'] = ucwords(strtolower(trim($data['address_1'])));
$data['address_2'] = ucwords(strtolower(trim($data['address_2'])));
$data['city'] = ucwords(strtolower(trim($data['city'])));
$data['postcode'] = strtoupper(trim($data['postcode']));
And a line before the ones you told me:
, company = '" . $this->db->escape($data['company']) . "'
Thank you very much for your help, I hope I can help someone in the future!!!

Newbie

Posts

Joined
Sun Mar 13, 2011 9:24 pm

Post by managermd » Wed Apr 20, 2011 9:51 pm

Hello
I did all setting but I saw thse errors after registration

catalog/model/account/customer.php on line 7Warning: Cannot modify header information - headers
system/engine/controller.php on line 27

Anybody cna help me about the reason pelase?
Regards

Newbie

Posts

Joined
Sun Jan 02, 2011 8:45 am

Post by inactiveaccount9912 » Wed Apr 20, 2011 10:10 pm

Is a download at the end of the topic http://forum.opencart.com/viewtopic.php?f=21&t=30473

All the respect!

Expert Member

Posts

Joined
Fri May 14, 2010 2:36 am

Post by Tromas » Fri May 13, 2011 1:12 am

I only edited create.tpl

Removed fax, company, address 2, zone and country.

It seems to work, but Do I have surprises waiting for me?

It can't be that easy? :joker:

Edit: version 1.4.9.3

Only problem is that some fileds have moved to the left:
http://bildr.no/view/881610

Anbefalt vibrator
Dildo i glass og metall
Myke sex leketøy i silikon


New member

Posts

Joined
Sat Feb 12, 2011 1:06 am


Post by Ampeter » Wed May 18, 2011 3:56 am

Tromas wrote:I only edited create.tpl

Removed fax, company, address 2, zone and country.

It seems to work, but Do I have surprises waiting for me?

It can't be that easy? :joker:

Edit: version 1.4.9.3

Only problem is that some fileds have moved to the left:
http://bildr.no/view/881610

To solve the thing with your fields "moving to the left" you have to replace:

Code: Select all

<td><span class="required">*</span> <?php echo $entry_address_1; ?></td>
with:

Code: Select all

<td width="150"><span class="required">*</span> <?php echo $entry_address_1; ?></td>
since you removed the row with the company name which was defining width.

Just so you know, removing those lines in the .tpl wasn't enough in my case. It worked all right in a local install of 1.9.3, but when I put it online I had to edit the model and controller files or I would get "Undefined Index" errors (maybe something to do with error reporting settings?).

User avatar
New member

Posts

Joined
Thu Jan 13, 2011 5:01 pm
Who is online

Users browsing this forum: No registered users and 21 guests