@@ -117,12 +117,10 @@ discard block |
||
117 | 117 | $this->setSiteConfig($siteConfig); |
118 | 118 | |
119 | 119 | $fields = ($fields != null && $fields->exists()) ? |
120 | - $this->getProductFields($fields) : |
|
121 | - $this->getProductFields(FieldList::create()); |
|
120 | + $this->getProductFields($fields) : $this->getProductFields(FieldList::create()); |
|
122 | 121 | |
123 | 122 | $actions = ($actions != null && $actions->exists()) ? |
124 | - $this->getProductActions($actions) : |
|
125 | - $this->getProductActions(FieldList::create()); |
|
123 | + $this->getProductActions($actions) : $this->getProductActions(FieldList::create()); |
|
126 | 124 | $validator = (!empty($validator) || $validator != null) ? $validator : RequiredFields::create(); |
127 | 125 | |
128 | 126 | parent::__construct($controller, $name, $fields, $actions, $validator); |
@@ -131,7 +129,7 @@ discard block |
||
131 | 129 | $this->setAttribute('action', FoxyCart::FormActionURL()); |
132 | 130 | $this->disableSecurityToken(); |
133 | 131 | |
134 | - $this->setHTMLID($this->getTemplateHelper()->generateFormID($this) . "_{$product->ID}"); |
|
132 | + $this->setHTMLID($this->getTemplateHelper()->generateFormID($this)."_{$product->ID}"); |
|
135 | 133 | } |
136 | 134 | |
137 | 135 | /** |
@@ -143,8 +141,7 @@ discard block |
||
143 | 141 | { |
144 | 142 | //Requirements::javascript('dynamic/foxystripe: client/dist/javascript/scripts.min.js'); |
145 | 143 | $hiddenTitle = ($this->product->ReceiptTitle) ? |
146 | - htmlspecialchars($this->product->ReceiptTitle) : |
|
147 | - htmlspecialchars($this->product->Title); |
|
144 | + htmlspecialchars($this->product->ReceiptTitle) : htmlspecialchars($this->product->Title); |
|
148 | 145 | $code = $this->product->Code; |
149 | 146 | |
150 | 147 | if ($this->product->Available) { |
@@ -178,7 +175,7 @@ discard block |
||
178 | 175 | ->setValue( |
179 | 176 | ProductPage::getGeneratedValue($code, 'price', $this->product->Price, 'value') |
180 | 177 | ) |
181 | - );//can't override id |
|
178 | + ); //can't override id |
|
182 | 179 | if ($this->product->Weight > 0) { |
183 | 180 | $fields->push( |
184 | 181 | HiddenField::create('weight') |
@@ -221,7 +218,7 @@ discard block |
||
221 | 218 | ); |
222 | 219 | |
223 | 220 | $fields->push( |
224 | - HeaderField::create('submitPrice', '$' . $this->product->Price, 4) |
|
221 | + HeaderField::create('submitPrice', '$'.$this->product->Price, 4) |
|
225 | 222 | ->addExtraClass('submit-price') |
226 | 223 | ); |
227 | 224 | $fields->push( |
@@ -230,7 +227,7 @@ discard block |
||
230 | 227 | ); |
231 | 228 | |
232 | 229 | $this->extend('updatePurchaseFormFields', $fields); |
233 | - } else { |
|
230 | + }else { |
|
234 | 231 | $fields->push(HeaderField::create('submitPrice', 'Currently Out of Stock', 4)); |
235 | 232 | } |
236 | 233 | |
@@ -276,7 +273,7 @@ discard block |
||
276 | 273 | */ |
277 | 274 | protected function getProductOptionSet() |
278 | 275 | { |
279 | - $assignAvailable = function ($self) { |
|
276 | + $assignAvailable = function($self) { |
|
280 | 277 | /** @var OptionItem $self */ |
281 | 278 | $this->extend('updateFoxyStripePurchaseForm', $form); |
282 | 279 | $self->Available = ($self->getAvailability()) ? true : false; |