/var/www/html/wp-content/plugins/checkout-for-woocommerce/includes/Compatibility/Themes/Astra.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php

namespace Objectiv\Plugins\Checkout\Compatibility\Themes;

use 
Objectiv\Plugins\Checkout\Compatibility\CompatibilityAbstract;

class 
Astra extends CompatibilityAbstract {
    public function 
is_available(): bool {
        return 
defined'ASTRA_THEME_VERSION' );
    }

    public function 
run() {
        
$this->remove_astra_scripts();
    }

    public function 
remove_scripts( array $scripts ): array {
        
// This prevents basically all Astra Add-on scripts from loading
        
$scripts['astra-addon-js'] = 'astra-addon-js';

        return 
$scripts;
    }

    public function 
remove_astra_scripts() {
        if ( 
cfw_is_checkout() ) {
            
remove_all_actions'astra_get_js_files' );
        }
    }
}