| Conditions | 3 |
| Paths | 2 |
| Total Lines | 24 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | public function init() |
||
| 15 | { |
||
| 16 | parent::init(); |
||
| 17 | Requirements::javascript('framework/thirdparty/jquery/jquery.js'); |
||
| 18 | if ($this->data()->Available && $this->ProductOptions()->exists()) { |
||
| 19 | $formName = $this->PurchaseForm()->FormName(); |
||
| 20 | Requirements::javascriptTemplate( |
||
| 21 | 'foxystripe/javascript/out_of_stock.js', |
||
| 22 | [ |
||
| 23 | 'FormName' => $formName, |
||
| 24 | ], |
||
| 25 | 'foxystripe.out_of_stock' |
||
| 26 | ); |
||
| 27 | Requirements::javascriptTemplate( |
||
| 28 | 'foxystripe/javascript/product_options.js', |
||
| 29 | [ |
||
| 30 | 'FormName' => $formName, |
||
| 31 | ], |
||
| 32 | 'foxystripe.product_options' |
||
| 33 | ); |
||
| 34 | } |
||
| 35 | |||
| 36 | Requirements::customScript(<<<JS |
||
| 37 | var productID = {$this->data()->ID}; |
||
| 38 | JS |
||
| 54 |