'product_cat',
'field' => 'slug',
'terms' => explode(',', sanitize_text_field($_GET['product_cat'])),
'operator' => 'IN',
);
}
$shop_hero_selected_brand_slugs = array();
if ( !empty($_GET['product_brand']) ) {
$shop_hero_selected_brand_slugs = explode(',', sanitize_text_field($_GET['product_brand']));
$shop_hero_tax_query[] = array(
'taxonomy' => 'product_brand',
'field' => 'slug',
'terms' => $shop_hero_selected_brand_slugs,
'operator' => 'IN',
);
}
$shop_hero_product_ids = get_posts(array(
'post_type' => 'product',
'posts_per_page' => -1,
'fields' => 'ids',
'tax_query' => $shop_hero_tax_query,
));
$shop_hero_products_count = count($shop_hero_product_ids);
$shop_brand_term = null;
if ( !empty($shop_hero_selected_brand_slugs) ) {
$shop_hero_first_term = get_term_by('slug', trim($shop_hero_selected_brand_slugs[0]), 'product_brand');
if ( $shop_hero_first_term && !is_wp_error($shop_hero_first_term) ) {
$shop_brand_term = $shop_hero_first_term->parent ? get_term($shop_hero_first_term->parent, 'product_brand') : $shop_hero_first_term;
}
}
if ( $shop_brand_term ) {
$shop_hero_url_cat_slugs = !empty( $_GET['product_cat'] ) ? array_values( array_filter( array_map( 'trim', explode( ',', sanitize_text_field( $_GET['product_cat'] ) ) ) ) ) : array();
$shop_hero_generic_title = true;
if ( count( $shop_hero_url_cat_slugs ) === 1 ) {
$shop_hero_generic_title = false;
$shop_hero_cat_brand_terms = zen_get_cascaded_brands( $shop_hero_url_cat_slugs[0] );
$shop_hero_cat_brand_ids = is_array( $shop_hero_cat_brand_terms ) ? wp_list_pluck( $shop_hero_cat_brand_terms, 'term_id' ) : array();
if ( !in_array( $shop_brand_term->term_id, $shop_hero_cat_brand_ids ) ) {
$shop_hero_generic_title = true;
}
}
$shop_hero_tid = 'product_brand_' . $shop_brand_term->term_id;
$shop_hero_badge = get_field('shop_hero_badge', $shop_hero_tid) ?: 'Official Authorized Distributor';
$shop_hero_title_line1 = get_field('shop_hero_title_line1', $shop_hero_tid) ?: ($shop_brand_term->name . ' ' . ( $shop_hero_generic_title ? 'Generic' : 'Enterprise' ));
$shop_hero_title_highlight= get_field('shop_hero_title_highlight', $shop_hero_tid) ?: 'Product Catalog';
$shop_hero_subtitle = get_field('shop_hero_subtitle', $shop_hero_tid) ?: ('Browse the complete ' . $shop_brand_term->name . ' portfolio — genuine products sourced directly from authorized distribution channels.');
$shop_hero_breadcrumb_label = $shop_brand_term->name;
$shop_hero_breadcrumb_link = get_term_link($shop_brand_term);
$shop_hero_cta_heading = get_field('shop_sidebar_cta_heading', $shop_hero_tid) ?: 'Need Help Choosing?';
$shop_hero_cta_text = get_field('shop_sidebar_cta_text', $shop_hero_tid) ?: ('Our experts will help you find the right ' . $shop_brand_term->name . ' solution.');
$shop_hero_stat3_number = get_field('years', $shop_hero_tid) ?: '15+';
$shop_hero_stat3_label = get_field('years_text', $shop_hero_tid) ?: 'Years Experience';
$shop_hero_cat_count = count(get_terms(array('taxonomy'=>'product_brand','parent'=>$shop_brand_term->term_id,'hide_empty'=>true)));
} else {
$shop_hero_badge = get_field('shop_default_badge', 'option') ?: 'Official Authorized Distributor';
$shop_hero_title_line1 = get_field('shop_default_title_line1', 'option') ?: 'Explore Our';
$shop_hero_title_highlight= get_field('shop_default_title_highlight', 'option') ?: 'Product Catalog';
$shop_hero_subtitle = get_field('shop_default_subtitle', 'option') ?: 'Browse our complete product portfolio across all categories — genuine products sourced directly from authorized distribution channels.';
$shop_hero_breadcrumb_label = 'Shop';
$shop_hero_breadcrumb_link = home_url('/shop/');
$shop_hero_cta_heading = get_field('shop_default_sidebar_cta_heading', 'option') ?: 'Need Help Choosing?';
$shop_hero_cta_text = get_field('shop_default_sidebar_cta_text', 'option') ?: 'Our experts will help you find the right solution for your business.';
$shop_hero_stat3_number = get_field('shop_default_stat3_number', 'option') ?: '500+';
$shop_hero_stat3_label = get_field('shop_default_stat3_label', 'option') ?: 'Enterprises Served';
$shop_hero_cat_count_terms = get_terms(array('taxonomy'=>'product_cat','parent'=>0,'hide_empty'=>true));
$shop_hero_cat_count = count(array_filter($shop_hero_cat_count_terms, function($t){ return $t->slug !== 'uncategorized'; }));
}
?>
Our specialists can help you select the best Micron products for your infrastructure requirements. Get expert advice and competitive pricing.Looking for the Right Storage Solution?