Page 1 of 1

add text in address on register page

Posted: Mon Jun 04, 2012 2:23 am
by bwingwing
Hi, can anyone teach me that which file should be edited in order to add pre-text in address field on register page.

In my case, Local customers will pick up the product in store, most likely local customers no need to enter address. Therefore I want the default address field can show "pick up in store" on the address field. Customers no need to type a fake address at most of the time.

opercart v1.5.3.1

Thanks!!

Re: add text in address on register page

Posted: Mon Jun 04, 2012 5:00 am
by Avvici
Open catalog/controller/account/register.php and find this code:

Code: Select all

if (isset($this->request->post['address_1'])) {
    		$this->data['address_1'] = $this->request->post['address_1'];
		} else {
			$this->data['address_1'] = '';
		}

		if (isset($this->request->post['address_2'])) {
    		$this->data['address_2'] = $this->request->post['address_2'];
		} else {
			$this->data['address_2'] = '';
		}
Change it to this, filling in your desired pre-text:

Code: Select all

if (isset($this->request->post['address_1'])) {
    		$this->data['address_1'] = $this->request->post['address_1'];
		} else {
			$this->data['address_1'] = 'Your Pretext Goes Here';
		}

		if (isset($this->request->post['address_2'])) {
    		$this->data['address_2'] = $this->request->post['address_2'];
		} else {
			$this->data['address_2'] = 'Your Pretext Goes Here';
		}

Re: add text in address on register page

Posted: Mon Jun 04, 2012 10:09 am
by bwingwing
Great help, thanks a lot Avvici!!