@@ -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) { |
@@ -172,7 +169,7 @@ discard block |
||
172 | 169 | $code, |
173 | 170 | 'price', |
174 | 171 | $this->product->Price |
175 | - ))->setValue($this->product->Price));//can't override id |
|
172 | + ))->setValue($this->product->Price)); //can't override id |
|
176 | 173 | if ($this->product->Weight > 0) { |
177 | 174 | $fields->push(HiddenField::create(ProductPage::getGeneratedValue( |
178 | 175 | $code, |
@@ -214,7 +211,7 @@ discard block |
||
214 | 211 | ); |
215 | 212 | |
216 | 213 | $fields->push( |
217 | - HeaderField::create('submitPrice', '$' . $this->product->Price, 4) |
|
214 | + HeaderField::create('submitPrice', '$'.$this->product->Price, 4) |
|
218 | 215 | ->addExtraClass('submit-price') |
219 | 216 | ); |
220 | 217 | $fields->push( |
@@ -223,7 +220,7 @@ discard block |
||
223 | 220 | ); |
224 | 221 | |
225 | 222 | $this->extend('updatePurchaseFormFields', $fields); |
226 | - } else { |
|
223 | + }else { |
|
227 | 224 | $fields->push(HeaderField::create('submitPrice', 'Currently Out of Stock', 4)); |
228 | 225 | } |
229 | 226 | |
@@ -269,7 +266,7 @@ discard block |
||
269 | 266 | */ |
270 | 267 | protected function getProductOptionSet() |
271 | 268 | { |
272 | - $assignAvailable = function ($self) { |
|
269 | + $assignAvailable = function($self) { |
|
273 | 270 | /** @var OptionItem $self */ |
274 | 271 | $this->extend('updateFoxyStripePurchaseForm', $form); |
275 | 272 | $self->Available = ($self->getAvailability()) ? true : false; |