Post by bwingwing » Mon Jun 04, 2012 2:23 am

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!!

New member

Posts

Joined
Sun Oct 24, 2010 3:54 am

Post by Avvici » Mon Jun 04, 2012 5:00 am

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';
		}

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC

Post by bwingwing » Mon Jun 04, 2012 10:09 am

Great help, thanks a lot Avvici!!

New member

Posts

Joined
Sun Oct 24, 2010 3:54 am
Who is online

Users browsing this forum: No registered users and 88 guests