@@ -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 | $fields->push(HiddenField::create(ProductPage::getGeneratedValue( |
177 | 174 | $code, |
178 | 175 | 'weight', |
@@ -212,7 +209,7 @@ discard block |
||
212 | 209 | ); |
213 | 210 | |
214 | 211 | $fields->push( |
215 | - HeaderField::create('submitPrice', '$' . $this->product->Price, 4) |
|
212 | + HeaderField::create('submitPrice', '$'.$this->product->Price, 4) |
|
216 | 213 | ->addExtraClass('submit-price') |
217 | 214 | ); |
218 | 215 | $fields->push( |
@@ -221,7 +218,7 @@ discard block |
||
221 | 218 | ); |
222 | 219 | |
223 | 220 | $this->extend('updatePurchaseFormFields', $fields); |
224 | - } else { |
|
221 | + }else { |
|
225 | 222 | $fields->push(HeaderField::create('submitPrice', 'Currently Out of Stock', 4)); |
226 | 223 | } |
227 | 224 | |
@@ -267,7 +264,7 @@ discard block |
||
267 | 264 | */ |
268 | 265 | protected function getProductOptionSet() |
269 | 266 | { |
270 | - $assignAvailable = function ($self) { |
|
267 | + $assignAvailable = function($self) { |
|
271 | 268 | /** @var OptionItem $self */ |
272 | 269 | $this->extend('updateFoxyStripePurchaseForm', $form); |
273 | 270 | $self->Available = ($self->getAvailability()) ? true : false; |