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
We've moved the forum!
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
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, Ed, frankmullenger, biapar, Willr, Ingo, Jedateach, swaiba
Editing check out Page
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!
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