Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
27 | public function updateCMSFields(FieldList $fields) |
||
28 | { |
||
29 | $fields->removeByName([ |
||
30 | 'DiscountID', |
||
31 | ]); |
||
32 | |||
33 | if ($this->owner->exists()) { |
||
34 | $fields->addFieldToTab( |
||
35 | 'Root.Main', |
||
36 | $discountButton = HasOneButtonField::create($this->owner, 'Discount'), |
||
37 | 'FirstName' |
||
38 | ); |
||
39 | |||
40 | $discountButton->getConfig()->removeComponentsByType(GridFieldAddExistingAutocompleter::class); |
||
41 | } |
||
44 |