Beispiel #1
1
add_filter( 'yith-wcan-frontend-args', 'yit_wcan_change_pagination_class' );

if(is_catalog_mode_installed()){
    // disable the remove action of the plugin
    add_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 999 );
    // delete add to cart button of the plugin
    add_filter("catalog_visibility_alternate_add_to_cart_link",create_function( '', '' ),999);
}

add_action( 'init', 'yit_plugins_support' );

/* quick view compatibility */

if ( function_exists( 'YITH_WCQV_Frontend' ) ) {

    $quick_view = YITH_WCQV_Frontend();
    $position = isset($quick_view->position) ? $quick_view->position : 'add-cart';

    if ( $position == 'add-cart') {
        remove_action( 'woocommerce_after_shop_loop_item', array( $quick_view, 'yith_add_quick_view_button' ), 15 );
    }

    add_action( 'yith_quick_view_custom_style_scripts' , 'yit_quick_view_add_selectbox_js' );

    add_filter( 'yith_quick_view_loader_gif', 'yit_get_ajax_loader_gif_url' );

    remove_action( 'yith_wcqv_product_image', 'woocommerce_show_product_sale_flash', 10 );
}

if ( ! function_exists( 'is_quick_view' ) ) {
 /**
  * Constructor
  *
  * @return mixed| YITH_WCQV_Admin | YITH_WCQV_Frontend
  * @since 1.0.0
  */
 public function __construct()
 {
     // Load Plugin Framework
     add_action('plugins_loaded', array($this, 'plugin_fw_loader'), 15);
     // Class admin
     if (is_admin()) {
         YITH_WCQV_Admin();
     }
     // Class frontend
     $enable = get_option('yith-wcqv-enable') == 'yes' ? true : false;
     $enable_on_mobile = get_option('yith-wcqv-enable-mobile') == 'yes' ? true : false;
     // Class frontend
     if (!wp_is_mobile() && $enable || wp_is_mobile() && $enable_on_mobile && $enable) {
         YITH_WCQV_Frontend();
     }
 }
Beispiel #3
0
                echo $product->get_rating_html( 'shop_loop' );
            } ?>
            <?php echo $out_of_stock; ?>
            <?php if ( $product->is_purchasable() || $product->product_type == 'external' ) {
                echo $add_to_cart;

                $is_whislist = function_exists( 'yith_wcwl_is_wishlist' ) && yith_wcwl_is_wishlist();

                if ( function_exists( 'YITH_WCQV_Frontend' ) && ! $is_whislist ) {

                    $quick_view = YITH_WCQV_Frontend();

                    $position = isset($quick_view->position) ? $quick_view->position : 'add-cart';

                    if ( $position == 'add-cart' ) {
                        YITH_WCQV_Frontend()->yith_add_quick_view_button();
                    }
                }

            } ?>
            <?php if( ! $is_wishlist ): ?>
            <div class="buttons buttons_<?php echo $count_buttons ?> group">
                <?php echo implode( "\n", $buttons ) ?>
            </div>
            <?php endif; ?>
        </div>
    </div>
<?php endif; ?>

<?php if ( $show_share ): ?>
    <?php if ( $sharethis_allowed ): ?>