get_settings( 'show_default_sale' ) === 'false' ) { add_filter( 'astra_addon_shop_cards_buttons_html', array( $this, 'astra_addon_shop_cards_buttons_html' ) ); } } /* * Change display hooks */ public function awl_labels_hooks( $hooks ) { $hooks['on_image']['single']['woocommerce_product_thumbnails'] = array( 'priority' => 10, 'js' => array( '.woocommerce-product-gallery > .flex-viewport', 'append' ) ); $hooks['before_title']['archive'] = array( 'astra_woo_shop_title_before' => array( 'priority' => 10 ) ); $hooks['before_title']['single'] = array( 'astra_woo_single_title_before' => array( 'priority' => 10 ) ); if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] === 'ast_load_product_quick_view' ) { $hooks['on_image']['archive']['post_thumbnail_html'] = array( 'priority' => 10, 'type' => 'filter', 'callback' => array( $this, 'post_thumbnail_html' ), 'args' => 4 ); } return $hooks; } /* * Display on_image labels */ public function post_thumbnail_html( $html, $post_id, $post_thumbnail_id, $size ) { if ( isset( $this->data['is_quick_view'] ) && $this->data['is_quick_view'] ) { $html = $html . AWL_Label_Display::instance()->show_label( 'on_image' ); $this->data['is_quick_view'] = false; } return $html; } /* * Hide default out-of-stock flash if this option is enables */ public function hide_default_stock_flash() { remove_action( 'woocommerce_shop_loop_item_title', 'astra_woo_shop_out_of_stock', 8 ); add_filter( 'astra_woo_shop_out_of_stock_string', 'AWL_Integrations_Callbacks::return_empty_string', 999 ); } /* * Hide sale flash */ public function astra_addon_shop_cards_buttons_html( $markup ) { $markup = str_replace( 'class="ast-on-card-button ast-onsale-card', 'style="display:none;" class="ast-on-card-button ast-onsale-card', $markup ); return $markup; } public function astra_woo_qv_product_image() { $this->data['is_quick_view'] = true; } } endif; AWL_Astra::instance();