Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Form Fields

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

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

Page: 1
Go to End
Author Topic: 813 Views
  • tomato
    Avatar
    Community Member
    13 Posts

    Form Fields Link to this post

    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

    813 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.