Browse Source

Adiciona opção de desativar a folha de estilos.

master
Guilherme Capanema 6 years ago
parent
commit
34cb2bc16e
3 changed files with 10 additions and 3 deletions
  1. +6
    -0
      admin/class-wc-cdp-admin.php
  2. +3
    -2
      includes/class-wc-cdp.php
  3. +1
    -1
      public/partials/product-bundle-modal.php

+ 6
- 0
admin/class-wc-cdp-admin.php View File

@ -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;


+ 3
- 2
includes/class-wc-cdp.php View File

@ -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);
}


+ 1
- 1
public/partials/product-bundle-modal.php View File

@ -105,7 +105,7 @@
<?php endif; ?>
<button type="submit" class="<?php echo apply_filters( 'wc_cdp_add_to_cart_button_class', 'button wc-forward alt wc_cdp_add_to_cart_button' ); ?>">
<?php echo apply_filters( 'wc_cdp_add_to_cart_text', get_option( 'wc_cdp_add_to_cart_text' ) ); ?>
<?php echo apply_filters( 'wc_cdp_add_to_cart_button_text', get_option( 'wc_cdp_add_to_cart_text' ) ); ?>
</button>
</div>


Loading…
Cancel
Save