Products
Promo
Services
Where to Buy
Why GE
$unused) { return $key; } return NULL; } } function generate_breadcrumb($name, $url='', $i=0) { if(empty($url)) { return '
' . $name . '
'; } return '
' . l($name, $url, array( 'attributes' => array( 'class' => array('easy-breadcrumb_segment', 'easy-breadcrumb_segment-' . $i) ) ) ) . '
'; } $breadcrumb = array(); $view = views_get_page_view(); if (is_object($view)) { // dpm($view->name); // dpm($view->current_display); if($view->name == 'u_products' && strpos($view->current_display, 'products_inner') !== FALSE) { $product = commerce_product_load_by_sku($view->args[0]); // dpm($product); $query = new EntityFieldQuery; $query->entityCondition('entity_type', 'node', '=') ->propertyCondition('type', 'product_display') ->fieldCondition('field_products', 'product_id', $product->product_id, '='); $result = $query->execute(); $nid = array_key_first($result['node']); $node = node_load($nid); // dpm($node); $branch_term = taxonomy_term_load($node->field_branch['und'][0]['tid']); $field_cat = strtolower($branch_term->name); if($branch_term->name == 'GE Appliances') { $field_cat = 'ge'; } else if($branch_term->name == 'GE Water & Pentair') { $field_cat = 'water'; } $field_name = 'field_prod_cat_' . $field_cat; $cat_id = $node->$field_name['und'][0]['tid']; $tree = taxonomy_get_parents_all($cat_id); $category_tree = array_reverse($tree); // dpm($category_tree); $i = 3; $breadcrumb[] = generate_breadcrumb($branch_term->name, drupal_get_path_alias('taxonomy/term/' . $branch_term->tid), 1); $breadcrumb[] = generate_breadcrumb('Products', drupal_get_path_alias('taxonomy/term/' . $branch_term->tid) . '/products', 2); foreach($category_tree as $category_term) { $breadcrumb[] = generate_breadcrumb($category_term->name, drupal_get_path_alias('taxonomy/term/' . $category_term->tid), $i++); } $breadcrumb[] = generate_breadcrumb($node->title); } } else { $term = menu_get_object('taxonomy_term', 2); if($term) { // dpm($term); $current_path_alias = explode('/', request_path()); $branch_path_normal = drupal_get_normal_path($current_path_alias[0]); $branch_path = explode('/', $branch_path_normal); $branch_term = taxonomy_term_load(end($branch_path)); // dpm($branch_term); $tree = taxonomy_get_parents_all($term->tid); $category_tree = array_reverse($tree); $max = count($category_tree); $i = 3; $breadcrumb[] = generate_breadcrumb($branch_term->name, drupal_get_path_alias('taxonomy/term/' . $branch_term->tid), 1); $breadcrumb[] = generate_breadcrumb('Products', drupal_get_path_alias('taxonomy/term/' . $branch_term->tid) . '/products', 2); foreach($category_tree as $i => $category_term) { if($i < $max-1) { $breadcrumb[] = generate_breadcrumb($category_term->name, drupal_get_path_alias('taxonomy/term/' . $category_term->tid), $i++); } else { $breadcrumb[] = generate_breadcrumb($category_term->name); } } } } // dpm($breadcrumb); ?>
/ ', $breadcrumb); ?>
GE Appliances
/
Categories
/
Refrigerator
/
Two Door Direct Cool
CoolBiz Series
GE Appliances GMV070BAYRAG 7cuft
GE Appliances GMV070BAYRAW 7cuft
GE Appliances GMV080BAGRSG 8cuft Cool Biz Ref
GE Appliances GMV090BAGRSG 9cuft Cool Biz Ref
GE Appliances GMV100BAYRAG 10cuft
GE Appliances GMV100BAYRAW 10cuft
GE Appliances GMV130BAGRSG 13cuft Cool Biz Ref
GE Appliances GMV130BAYRAG 13cuft
GE Appliances GMV130BAYRAW 13cuft
GE Appliances Products
Air Conditioner
Window Aircon Mechanical Control
Window Aircon Digital Control
Split Type Aircon Premium Inverter
Refrigerator
Single Door
Top Mount No Frost
Two Door Direct Cool
CoolBiz Series
Side by Side
Bar Fridge
Freezer
Chest Freezer
Upright Freezer
Laundry Center
More Products
Microwave Oven
Water Dispenser
Wine Chiller