1 | <?php |
||
2 | |||
3 | namespace Dynamic\FoxyStripe\ORM; |
||
4 | |||
5 | use Dynamic\FoxyStripe\Model\FoxyCart; |
||
6 | use Dynamic\FoxyStripe\Model\FoxyStripeSetting; |
||
7 | use SilverStripe\Core\Extension; |
||
8 | use SilverStripe\View\Requirements; |
||
9 | |||
10 | class FoxyStripePageExtension extends Extension |
||
11 | { |
||
12 | /** |
||
13 | * @throws \SilverStripe\ORM\ValidationException |
||
14 | */ |
||
15 | public function onAfterInit() |
||
16 | { |
||
17 | $config = FoxyStripeSetting::current_foxystripe_setting(); |
||
18 | |||
19 | if ($config->EnableSidecart) { |
||
0 ignored issues
–
show
Bug
Best Practice
introduced
by
![]() |
|||
20 | Requirements::javascript( |
||
21 | "https://cdn.foxycart.com/" . FoxyCart::getFoxyCartStoreName() . "/loader.js", |
||
22 | [ |
||
23 | "async" => true, |
||
24 | "defer" => true, |
||
25 | ] |
||
26 | ); |
||
27 | } |
||
28 | } |
||
29 | } |
||
30 |