ID; $product_db_id=callDBStored($wpdb->prepare("call IPER_MA_PRODUCT_GET_ID_BY_WPID(%d)",$product_wp_id),true); $product_db_id=$product_db_id->idPRODUCT; $rateplan_call = $wpdb->prepare("CALL IPER_MA_RATEPLAN_LIST(%d)", $product_db_id); $rate_plans = callDBStored($rateplan_call); $they_exist = 0; foreach ($rate_plans as $rate_plan) { $rateplanID = $rate_plan->idRATEPLAN; $accessory_group_list_call = $wpdb->prepare("CALL IPER_MA_ACCESSORY_GROUP_LIST(%d)", $rateplanID); $groups_accessories = callDBStored($accessory_group_list_call); if($groups_accessories) { $counter = 0; $they_exist++; foreach ($groups_accessories as $group) { $is_free = $group->IncludedWithOrder; $accessory_single_selection = $group->LimitRestriction; if($is_free=='1' && $accessory_single_selection=='0'){ $counter++; } if($counter != count($groups_accessories)){ $they_exist='1'; }else { $they_exist='0';} } } else { $they_exist='0';} } $they_exist='0'; if($post->ID==$config['id_medical_home']){ echo get_nav_bredcrumb(1, $they_exist); } if($post->post_type=='product'){ echo get_nav_bredcrumb(2, $they_exist); } if($post->ID==$config['id_medical_accessories']){ echo get_nav_bredcrumb(3, $they_exist); } if($post->ID==$config['id_medical_shipping']){ echo get_nav_bredcrumb(4, $they_exist); } if($post->ID==$config['id_medical_order']){ echo get_nav_bredcrumb(5, $they_exist); } if($post->ID==$config['id_medical_profile']){ echo get_nav_bredcrumb(6, $they_exist); } if($post->ID==$config['id_medical_thank']){ echo get_nav_bredcrumb(7, $they_exist); } function get_nav_bredcrumb($ord, $acc){ $actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; function link_active($link){ $actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; if($actual_link == $link){ return 'active';} } $aProduct=false; foreach($_SESSION['iper_cart']['products'] as $single){ $aProduct=$single; } global $indice; if($acc>0){ $accessory_exist='1'; $link_previous_shipping = get_permalink(get_option('id_medical_accessories')); $link_after_plan=array( get_permalink(get_option('id_medical_accessories')), 'Medical Accessories'); } else{ $accessory_exist='0'; $link_previous_shipping = get_permalink($aProduct["wp_id"]); $link_after_plan=array(get_permalink(get_option('id_medical_shipping')), 'Shipping & Billing'); } $html = '
  • 1 Products
  • '; if($ord==1){ }elseif($ord>=2) { if ($ord>=2) { if($ord==2){ $actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; } else {$actual_link = get_permalink($aProduct["wp_id"]);} $back = '
  • Go Back
  • '; $html .= '
  • 2 Payment Plan
  • '; $next_link = '
  • 3 '.$link_after_plan[1].'
  • '; } if ($ord>=3 && $accessory_exist=='1') { $back = '
  • Go Back
  • '; $html .= '
  • 3 Medical Accessories
  • '; $next_link = '
  • 4 Shipping & Billing
  • '; } if ($ord>=4) { $indice=3+$accessory_exist; $back = '
  • Go Back
  • '; $html .= '
  • '.$indice.' Shipping & Billing
  • '; $next_link = '
  • '.($indice+1).' Your Order
  • '; } if ($ord>=5) { $indice=4+$accessory_exist; $back = '
  • Go Back
  • '; $html .= '
  • '.$indice.' Your Order
  • '; $next_link = '
  • '.($indice+1).' Profile Set Up
  • '; } if ($ord>=6) { $indice=5+$accessory_exist; $back = '
  • Go Back
  • '; $html .= '
  • '.$indice.' Profile Set Up
  • '; /* $next_link = '
  • 7 Thank You
  • ';*/ $next_link = '
  • '.($indice+1).' Profile Completed
  • '; } if ($ord==7) { $back = '
  • Go Back
  • '; /* $html .= '
  • 7 Thank You
  • ';*/ $html .= '
  • '.$indice.' Profile Completed
  • '; $next_link = ''; } } $html .= $next_link; $final_res = $back.$html; return $final_res; } ?>