Plugin Directory

Changeset 1777704


Ignore:
Timestamp:
11/29/2017 01:40:08 PM (8 years ago)
Author:
devlucasmendes
Message:

Novo botão para limpar filtros; Melhora na exibição do texto do botão comprar

Location:
fastdee/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • fastdee/trunk/assets/js/import-page.js

    r1771929 r1777704  
    2424        jQuery('#fd-atual-page').on('change', function () {
    2525            fd_get_offers(jQuery(this).val());
     26        });
     27
     28        jQuery('#fd_btnLimparFiltros').on('click', function () {
     29            jQuery('#fd_categoria').val('').trigger('change');
     30            jQuery('#fd_loja').val('').trigger('change');
     31            jQuery('#fd_palavra-chave').val('');
     32            jQuery('.fd_offers_preview').hide();
    2633        });
    2734
  • fastdee/trunk/includes/core/class-fd-util.php

    r1773961 r1777704  
    1313        add_action( 'wp_enqueue_scripts', array( $this, 'fd_public_site_add_scripts' ) );
    1414
    15         add_filter( 'woocommerce_product_single_add_to_cart_text', array( $this, 'fd_wc_add_to_cart_custom_text' ), 9 );
    16         add_filter( 'woocommerce_product_add_to_cart_text', array( $this, 'fd_wc_add_to_cart_custom_text' ), 9 );
     15        add_filter( 'woocommerce_product_single_add_to_cart_text', array( $this, 'fd_wc_add_to_cart_custom_text' ), 9, 2 );
     16        add_filter( 'woocommerce_product_add_to_cart_text', array( $this, 'fd_wc_add_to_cart_custom_text' ), 9, 2 );
    1717
    1818        //product - botao de compra _blank substituir btn
     
    8686    }
    8787
    88     function fd_wc_add_to_cart_custom_text( $text ) {
    89         // tem texto no botao e nao é o default
    90         if ( $text && ! in_array( strtolower( $text ), array( 'add to cart', 'buy product', 'comprar produto', 'adicionar ao carrinho' ) ) ) {
    91             return $text;
    92         }
    93 
    94         $options = get_option( 'fd_settings' );
    95         if ( isset( $options['fd_btn_woocomerce_text'] ) && $options['fd_btn_woocomerce_text'] ) {
    96             return $options['fd_btn_woocomerce_text'];
     88    function fd_wc_add_to_cart_custom_text( $text, $product ) {
     89
     90        if ( 'external' === $product->get_type() ) {
     91
     92            $options = get_option( 'fd_settings' );
     93            if ( isset( $options['fd_btn_woocomerce_text'] ) && $options['fd_btn_woocomerce_text'] ) {
     94                $text = $options['fd_btn_woocomerce_text'];
     95            }
     96
     97            // se tem texto no botao
     98            if ( $product->button_text ) {
     99                $text = $product->button_text;
     100            }
    97101        }
    98102
  • fastdee/trunk/includes/pages/class-fd-import-page.php

    r1762707 r1777704  
    9191        <!-- .end -->
    9292
     93        <div class="" style="text-align: right;padding-right: 374px;">
     94            <input type="button" id="fd_btnLimparFiltros" class="button button-primary fd-btn-red" value="Limpar Filtros">
     95        </div>
     96
    9397        <p class="submit">
    9498            <input type="button" id="fd_btnGetOffers" class="button button-primary fd-btn-red" value="Buscar Ofertas">
Note: See TracChangeset for help on using the changeset viewer.