10, 'type' => 'filter', 'callback' => array( $this, 'woocommerce_single_product_image_thumbnail_html' ), 'args' => 1 ); } else { $hooks['on_image']['single']['woocommerce_before_single_product_summary'] = array( 'priority' => 10, 'js' => array( '.product-gallery .product-images', 'append' ) ); $hooks['on_image']['single']['flatsome_sale_flash'] = array( 'priority' => 10 ); } $hooks['on_image']['archive']['flatsome_woocommerce_shop_loop_images'] = array( 'priority' => 12 ); $hooks['on_image']['archive']['flatsome_product_box_tools_top'] = array( 'priority' => 10, 'js' => array( '.box-image', 'append' ) ); if ( isset( $_REQUEST['action'] ) && 'flatsome_quickview' === $_REQUEST['action'] ) { $hooks['before_title']['single'] = array( 'the_title' => array( 'priority' => 10, 'type' => 'filter', 'before' => true ) ); } return $hooks; } /* * Show label for stacked layout images gallery */ public function woocommerce_single_product_image_thumbnail_html( $html ) { $image = AWL_Label_Display::instance()->show_label( 'on_image' ); if ( $image && ! isset( $this->data['stacked'] ) ) { $html = str_replace('data['stacked'] = true; } return $html; } /* * Product quick view pop-up */ public function woocommerce_before_single_product_lightbox_summary() { echo AWL_Label_Display::instance()->show_label( 'on_image' ); } /* * Change labels container styles */ public function awl_label_container_styles( $styles, $position_type, $labels ) { global $wp_filter, $wp_current_filter; if ( $position_type === 'on_image' && in_array( 'flatsome_woocommerce_shop_loop_images', $wp_current_filter ) ) { $styles['z-index'] = '0'; } return $styles; } /* * Enable labels for Flatsome preview */ public function awl_enable_labels( $enable ) { if ( isset( $_REQUEST['action'] ) && 'flatsome_quickview' === $_REQUEST['action'] ) { $enable = true; } return $enable; } /* * JS selector for product container */ public function awl_js_container_selectors( $container ) { $container[] = '.product-small'; return $container; } /* * Detect single label type */ public function awl_labels_single_type_hooks( $single_hooks ) { $single_hooks[] = 'flatsome_after_product_images'; $single_hooks[] = 'flatsome_sale_flash'; return $single_hooks; } } endif; AWL_Flatsome::instance();