Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

E-Commerce Modules /

Discuss about the various e-commerce modules available:
Ecommerce, SS Shop, SilverCart and SwipeStripe
Alternatively, have a look the shared mailinglist.

Moderators: martimiz, Nicolaas, Sean, frankmullenger, biapar, Willr, Ingo, Jedateach, swaiba, simon_w

Editing check out Page


Reply


3 Posts   1079 Views

Avatar
butterzz

Community Member, 3 Posts

17 November 2009 at 7:55am

im trying to change the sur name section to last name but cant find where to do this i am a beggining designer can any one point me in the right direction

Avatar
supermegaultra

Community Member, 33 Posts

17 November 2009 at 10:02am

Hi butterzz,

Try editing OrderForm.php found in the ecommerce/code/ folder. There's reference to 'Surname' found on line 130 of that file.

Hope that works!

Avatar
Double-A-Ron

Community Member, 604 Posts

17 November 2009 at 11:37pm

Hi Butterz,

Line 130 of Order.php actually refers to the required field names, which should stay as the are for validation purposes.

If you are just wanting to change the label of the field, edit EcommerceRole.php line 75:

function getEcommerceFields() {
      $fields = new FieldSet(
         new HeaderField('Personal Information', 3),
         new TextField('FirstName', 'First Name'),
         new TextField('Surname', 'Surname'),
         new TextField('HomePhone', 'Phone'),
         new TextField('MobilePhone', 'Mobile'),
         new EmailField('Email', 'Email'),
         new TextField('Address', 'Address'),
         new TextField('AddressLine2', ''),
         new TextField('City', 'City'),
         new DropdownField('Country', 'Country', Geoip::getCountryDropDown(), self::findCountry())
      );
      
      $this->owner->extend('augmentEcommerceFields', $fields);
      
      return new CompositeField($fields);
      
   }

The first argument for each of those fields is the field name - these should stay as they are. The second argument can be changed and the label should change for you.

E.G.

function getEcommerceFields() {
      $fields = new FieldSet(
         new HeaderField('Personal Information', 3),
         new TextField('FirstName', 'First Name'),
         new TextField('Surname', 'Last Name'),
         new TextField('HomePhone', 'Phone'),
         new TextField('MobilePhone', 'Mobile'),
         new EmailField('Email', 'Email'),
         new TextField('Address', 'Address'),
         new TextField('AddressLine2', ''),
         new TextField('City', 'City'),
         new DropdownField('Country', 'Country', Geoip::getCountryDropDown(), self::findCountry())
      );
      
      $this->owner->extend('augmentEcommerceFields', $fields);
      
      return new CompositeField($fields);
      
   }

Aaron