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.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Form Fields


Reply


891 Views

Avatar
tomato

Community Member, 13 Posts

18 August 2008 at 4:28am

Hi
I need to add a field to a product order form which editable by the user. To add extra detail about the product being bought. ie what colour is wanted.
Not quite sure how to adapt this and where to put it
class MyCustomRole extends DataObjectDecorator {
   function augmentEcommerceFields(&$fields) {
      // Returning users shouldn't be shown phone / email fields
      if($this-owner->ID) {
         $fields->removeByName('HomePhone');
         $fields->removeByName('MobilePhone');
         $fields->removeByName('Email');
      }

   }
}
Thanks in advance