1 | <?php |
||
2 | |||
3 | namespace AntonyThorpe\SilvershopBankDeposit; |
||
4 | |||
5 | use SilverStripe\Forms\TextareaField; |
||
6 | use SilverStripe\Forms\TextField; |
||
7 | use SilverStripe\Forms\HTMLEditor\HTMLEditorField; |
||
8 | use SilverStripe\Forms\FieldList; |
||
9 | use SilverStripe\ORM\DataExtension; |
||
10 | |||
11 | class ShopConfigExtension extends DataExtension |
||
12 | { |
||
13 | private static $db = [ |
||
0 ignored issues
–
show
introduced
by
Loading history...
|
|||
14 | 'BankAccountPaymentMethodMessage' => 'Text', |
||
15 | 'BankAccountNumber' => 'Text', |
||
16 | 'BankAccountDetails' => 'Text', |
||
17 | 'BankAccountInvoiceMessage' => 'HTMLText' |
||
18 | ]; |
||
19 | |||
20 | public function updateCMSFields(FieldList $fields): void |
||
21 | { |
||
22 | $fields->addFieldsToTab( |
||
23 | 'Root.Shop.ShopTabs.' . _t('SilverShop\Extension\ShopConfigExtension.BankAccountTitle', 'Bank Account'), |
||
24 | [ |
||
25 | Textfield::create( |
||
26 | "BankAccountPaymentMethodMessage", |
||
27 | _t( |
||
28 | "SilverShop\\Extension\\ShopConfigExtension.BankAccountPaymentMethodMessage", |
||
29 | "Payment Method message on Checkout page" |
||
30 | ) |
||
31 | )->setDescription( |
||
32 | _t( |
||
33 | "SilverShop\\Extension\\ShopConfigExtension.BankAccountPaymentMethodMessageDescription", |
||
34 | "Message to appear in the Payment Method section of Checkout Page" |
||
35 | ) |
||
36 | ), |
||
37 | Textfield::create( |
||
38 | "BankAccountNumber", |
||
39 | _t( |
||
40 | "SilverShop\\Extension\\ShopConfigExtension.BankAccountNumber", |
||
41 | "Bank Account Number" |
||
42 | ) |
||
43 | )->setDescription( |
||
44 | _t( |
||
45 | "SilverShop\\Extension\\ShopConfigExtension.BankAccountNumberDescription", |
||
46 | "e.g XX-XXXX-XXXXXXX-XX" |
||
47 | ) |
||
48 | ), |
||
49 | TextareaField::create( |
||
50 | "BankAccountDetails", |
||
51 | _t( |
||
52 | "SilverShop\\Extension\\ShopConfigExtension.BankAccountDetails", |
||
53 | "Bank Account Details" |
||
54 | ) |
||
55 | )->setDescription( |
||
56 | _t( |
||
57 | "SilverShop\\Extension\\ShopConfigExtension.BankAccountDetailsDescription", |
||
58 | "Account Name, Bank Name, Branch, Branch Address" |
||
59 | ) |
||
60 | ), |
||
61 | HtmlEditorField::create( |
||
62 | "BankAccountInvoiceMessage", |
||
63 | _t( |
||
64 | "SilverShop\\Extension\\ShopConfigExtension.BankAccountInvoiceMessage", |
||
65 | "Bank Account Order/Invoice Message" |
||
66 | ) |
||
67 | )->setDescription( |
||
68 | _t( |
||
69 | "SilverShop\\Extension\\ShopConfigExtension.BankAccountInvoiceMessageDescription", |
||
70 | "Message to appear on the order/invoice" |
||
71 | ) |
||
72 | ) |
||
73 | ] |
||
74 | ); |
||
75 | } |
||
76 | } |
||
77 |