@@ -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( |
@@ -234,7 +231,7 @@ discard block |
||
| 234 | 231 | } |
| 235 | 232 | |
| 236 | 233 | $this->extend('updatePurchaseFormFields', $fields); |
| 237 | - } else { |
|
| 234 | + }else { |
|
| 238 | 235 | $fields->push(HeaderField::create('submitPrice', 'Currently Out of Stock', 4)); |
| 239 | 236 | } |
| 240 | 237 | |