10 );
$hooks['on_image']['archive']['jet-woo-builder/templates/products-list/after-item-thumbnail'] = array( 'priority' => 10 );
if ( is_ajax() ) {
$hooks['before_title']['archive']['jet-woo-builder/templates/products/after-item-thumbnail'] = array( 'priority' => 10 );
$hooks['before_title']['archive']['jet-woo-builder/templates/products-list/after-item-thumbnail'] = array( 'priority' => 10 );
} else {
$hooks['before_title']['archive']['jet-woo-builder/templates/products/before-item-thumbnail'] = array( 'priority' => 10, 'js' => array( '.jet-woo-product-title', 'prepend' ) );
$hooks['before_title']['archive']['jet-woo-builder/templates/products-list/before-item-thumbnail'] = array( 'priority' => 10, 'js' => array( '.jet-woo-product-title', 'prepend' ) );
}
return $hooks;
}
/*
* JS selector for product container
*/
public function awl_js_container_selectors( $container ) {
$container[] = '[data-product-id]';
return $container;
}
/*
* Check if the listings contains products
*/
public function jet_pre_get_item_content( $content, $post_obj ) {
$this->data['is_product_listing'] = false;
if ( $post_obj && property_exists( $post_obj, 'post_type' ) && in_array( $post_obj->post_type, array( 'product', 'product_variation' ) ) ) {
$this->data['is_product_listing'] = true;
}
return $content;
}
/*
* Add labels for jet listing items
*/
function listing_content( $content ) {
if ( isset( $this->data['is_product_listing'] ) && $this->data['is_product_listing'] ) {
$on_image_label = AWL_Label_Display::instance()->show_label( 'on_image' );
$on_title_label = AWL_Label_Display::instance()->show_label( 'before_title' );
if ( strpos( $content, 'awl-position-type-on-image' ) === false ) {
$content = preg_replace( '//i', '