Post by slon » Sun Jan 22, 2012 7:40 pm

Hello!
By enrolling in an affiliate program shop, there are red stars, then you need to fill in, as they are removed (except the password), and that field was not required.

Thank you in advance for your reply.
P.S. Opencart v1.5.1.3
P.S.S. I'm sorry for my English.

Newbie

Posts

Joined
Sat Jan 21, 2012 7:10 pm

Post by OpenCart Addons » Mon Jan 23, 2012 8:35 am

Hey slon,

In catalog / controller / affiliate / register.php
Find the Function:

Code: Select all

private function validate() {
    	if ((utf8_strlen($this->request->post['firstname']) < 1) || (utf8_strlen($this->request->post['firstname']) > 32)) {
      		$this->error['firstname'] = $this->language->get('error_firstname');
    	}

    	if ((utf8_strlen($this->request->post['lastname']) < 1) || (utf8_strlen($this->request->post['lastname']) > 32)) {
      		$this->error['lastname'] = $this->language->get('error_lastname');
    	}

    	if ((utf8_strlen($this->request->post['email']) > 96) || !preg_match('/^[^\@]+@.*\.[a-z]{2,6}$/i', $this->request->post['email'])) {
      		$this->error['email'] = $this->language->get('error_email');
    	}

    	if ($this->model_affiliate_affiliate->getTotalAffiliatesByEmail($this->request->post['email'])) {
      		$this->error['warning'] = $this->language->get('error_exists');
    	}
		
    	if ((utf8_strlen($this->request->post['telephone']) < 3) || (utf8_strlen($this->request->post['telephone']) > 32)) {
      		$this->error['telephone'] = $this->language->get('error_telephone');
    	}

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

    	if ((utf8_strlen($this->request->post['city']) < 2) || (utf8_strlen($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'] && (utf8_strlen($this->request->post['postcode']) < 2) || (utf8_strlen($this->request->post['postcode']) > 10)) {
			$this->error['postcode'] = $this->language->get('error_postcode');
		}

    	if ($this->request->post['country_id'] == '') {
      		$this->error['country'] = $this->language->get('error_country');
    	}
		
    	if ($this->request->post['zone_id'] == '') {
      		$this->error['zone'] = $this->language->get('error_zone');
    	}

    	if ((utf8_strlen($this->request->post['password']) < 4) || (utf8_strlen($this->request->post['password']) > 20)) {
      		$this->error['password'] = $this->language->get('error_password');
    	}

    	if ($this->request->post['confirm'] != $this->request->post['password']) {
      		$this->error['confirm'] = $this->language->get('error_confirm');
    	}
		
		if ($this->config->get('config_affiliate_id')) {
			$this->load->model('catalog/information');
			
			$information_info = $this->model_catalog_information->getInformation($this->config->get('config_affiliate_id'));
			
			if ($information_info && !isset($this->request->post['agree'])) {
      			$this->error['warning'] = sprintf($this->language->get('error_agree'), $information_info['title']);
			}
		}
		
    	if (!$this->error) {
      		return true;
    	} else {
      		return false;
    	}
  	}
And remove the fields that are no longer required.

Example:
If the affiliate telephone number is no longer required, remove:

Code: Select all

if ((utf8_strlen($this->request->post['telephone']) < 3) || (utf8_strlen($this->request->post['telephone']) > 32)) {
      		$this->error['telephone'] = $this->language->get('error_telephone');
    	}


Regards,
Joel.

Canada's Leading Expert In OpenCart Development & Certified OpenCart Development Partner Image


User avatar
Active Member

Posts

Joined
Thu Nov 24, 2011 10:51 am
Location - Canada

Post by slon » Mon Jan 23, 2012 6:17 pm

Thank you for your help, helped

Newbie

Posts

Joined
Sat Jan 21, 2012 7:10 pm

Post by Gefagahaga » Wed Feb 15, 2012 6:51 pm

Can this method be used to remove Zone fields from guest checkouts/register forms?

Newbie

Posts

Joined
Tue Nov 29, 2011 6:21 pm

Post by OpenCart Addons » Sat Feb 18, 2012 2:06 am

Hey,

You might be able to apply this method. Be careful though as there are a number of extensions and built in features that reference the customers zone id.


Regards,
Joel.

Canada's Leading Expert In OpenCart Development & Certified OpenCart Development Partner Image


User avatar
Active Member

Posts

Joined
Thu Nov 24, 2011 10:51 am
Location - Canada

Post by yiyinlah » Sat Feb 25, 2012 12:05 am

How do I do this for return products page?

I'm trying to make the "model" field not a required field & when choosing products to return from order history, it will not pre-fill the model column. If possible, just remove the whole model thing.

Hope you'll reply as I really need your help! :)

Thank you!

I'm using Opencart 1.5.4.1 & vQmod 2.3.2.


User avatar
Active Member

Posts

Joined
Thu Sep 23, 2010 1:19 pm
Location - Singapore
Who is online

Users browsing this forum: No registered users and 3 guests