diff --git a/admin/class-wc-cdp-admin.php b/admin/class-wc-cdp-admin.php index e21c39a..e99a5e9 100755 --- a/admin/class-wc-cdp-admin.php +++ b/admin/class-wc-cdp-admin.php @@ -137,6 +137,12 @@ class Wc_Cdp_Admin { 'type' => 'text', ); + $settings_wc_cdp[] = array( + 'name' => __( 'Incluir folha de estilos padrĂ£o', 'wc-cdp' ), + 'id' => 'wc_cdp_enable_stylesheet', + 'type' => 'checkbox', + ); + $settings_wc_cdp[] = array( 'type' => 'sectionend', 'id' => 'wc-cdp' ); return $settings_wc_cdp; diff --git a/includes/class-wc-cdp.php b/includes/class-wc-cdp.php index c5d073c..9e9870c 100755 --- a/includes/class-wc-cdp.php +++ b/includes/class-wc-cdp.php @@ -176,14 +176,15 @@ class Wc_Cdp { $plugin_public = new Wc_Cdp_Public( $this->get_plugin_name(), $this->get_version() ); - $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); + if ( get_option( 'wc_cdp_enable_stylesheet' ) === 'yes' ) { + $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); + } $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' ); $this->loader->add_action( 'woocommerce_add_to_cart', $plugin_public, 'maybe_display_bundle_modal', 10, 2 ); $this->loader->add_action( 'admin_post_wc_cdp_add_to_cart', $plugin_public, 'add_bundle_to_cart' ); $this->loader->add_action( 'admin_post_nopriv_wc_cdp_add_to_cart', $plugin_public, 'add_bundle_to_cart' ); - // $this->loader->add_action( 'wp_loaded', $plugin_public, 'add_to_cart_multiple' , 15); } diff --git a/public/partials/product-bundle-modal.php b/public/partials/product-bundle-modal.php index e856268..a887aec 100644 --- a/public/partials/product-bundle-modal.php +++ b/public/partials/product-bundle-modal.php @@ -105,7 +105,7 @@