function tep_get_category_parents($categories_id = 0, $category_tree_array = '') { global $languages_id; if (!is_array($category_tree_array)) { $category_tree_array = array(); } $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd \n\t\t where c.categories_id='" . (int) $categories_id . "' and c.categories_id=cd.categories_id and cd.language_id = '" . (int) $languages_id . "' "); while ($categories = tep_db_fetch_array($categories_query)) { $category_tree_array[$categories['categories_id']] = $categories['categories_name']; if ($categories['parent_id'] != '0') { $category_tree_array = tep_get_category_parents($categories['parent_id'], $category_tree_array); } } return $category_tree_array; }
echo '<strong><i>' . AAS_TEXT_LINKED_PRODUCT . '</i></strong> <button data-cid="' . $caid . '" data-pid="' . $products['products_id'] . '" class="applyButton removeLinkedProduct">' . AAS_TEXT_REMOVE_LINKED_PRODUCT . '</button>'; if (isset($protoca_array[$products['products_id']])) { foreach ($protoca_array[$products['products_id']] as $kpropo => $propro) { echo '<br>'; if ($propro['linked'] == '0') { echo AAS_TEXT_ORIGINAL_PRODUCT_AT; $tjohn = array_reverse(tep_get_category_parents($propro['cid'])); array_pop($tjohn); echo count($tjohn) > 0 ? implode(' » ', $tjohn) : AAS_TEXT_TOP; echo ' » <a href="' . tep_href_link(FILENAME_AAS, 'cPath=' . $propro['cid']) . '">' . $propro['cname'] . '</a><br><br>'; } else { if ((int) $propro['cid'] == $caid) { continue; } echo AAS_TEXT_ALSO_LINKED_WITH; $tjohn = array_reverse(tep_get_category_parents($propro['cid'])); array_pop($tjohn); echo count($tjohn) > 0 ? implode(' » ', $tjohn) : AAS_TEXT_TOP; echo ' » <a href="' . tep_href_link(FILENAME_AAS, 'cPath=' . $propro['cid']) . '">' . $propro['cname'] . '</a><br>'; } } } } ?> </td> <?php } break; case 'sort_order': if (isset($aasAac['fields_disable_action'][$key][$_SESSION['admin']['id']]) && $aasAac['fields_disable_action'][$key][$_SESSION['admin']['id']]) { echo '<td class="nojedit products_sort_order ' . $_table_td_rules[$key]['class'] . '" data-column="products_' . $key . '" >' . (isset($products['products_sort_order']) ? $products['products_sort_order'] : '---') . '</td>';