Remember me? forgot password | register

SilverStripe Forum

1172 Posts in 334 Topics by 320 members

Jump to:

Website Authors

If this is your first visit, you will need to register before you can post. However, you can browse all messages below.

Community » SilverStripe Forum » Website Authors » Form Fields
Page: 1 go to end Reply
Author Topic: Form Fields 175 views
  • tomato
    tomato's avatar
    Community Member
    4 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

    175 views
go to top Reply

Currently Online:

Craig, LeeUmm, simon_w

Welcome to our latest member: sarahlynn