function xtc_get_product_path($products_id)
{
    $cPath = '';
    $category_query = "select p2c.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = '" . (int) $products_id . "' and p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id != 0";
    $category_query = xtDBquery($category_query);
    if (xtc_db_num_rows($category_query, true)) {
        #Default category( first picked from table)
        $category = xtc_db_fetch_array($category_query);
        $p_path_full = $_SERVER['REQUEST_URI'];
        $p_path = $_SERVER['QUERY_STRING'];
        #If we display product check linked categories
        if (strpos($p_path, 'products_id') !== false) {
            while ($categoryies = xtc_db_fetch_array($category_query)) {
                $cat_name = xtc_get_categories_name($categoryies['categories_id']);
                $cat_name_slug = shopstat_hrefSmallmask($cat_name);
                $p_path_full_array = explode('/', $p_path_full);
                if ($p_path_full_array[count($p_path_full_array) - 2] === $cat_name_slug) {
                    $category = $categoryies;
                    break;
                }
            }
        }
        # Check if current categorie or its children have linked product
        $c_path = $_SERVER['QUERY_STRING'];
        if (strpos($c_path, 'cPath') !== false) {
            $category_path = substr($c_path, strpos($c_path, '=') + 1);
            $categorie_previous = end(explode('_', $category_path));
            $cat_children = array();
            $cat_children = xtc_get_categories_children($categorie_previous);
            foreach ($cat_children as $linked_cat) {
                $category_query_check = "select p2c.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = '" . (int) $products_id . "' and p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id != 0 and p2c.categories_id = '" . $linked_cat . "'";
                $category_query_check = xtDBquery($category_query_check);
                if (xtc_db_num_rows($category_query_check, true)) {
                    $category = xtc_db_fetch_array($category_query_check);
                    break;
                }
            }
        }
        $categories = array();
        xtc_get_parent_categories($categories, $category['categories_id']);
        $categories = array_reverse($categories);
        $cPath = implode('_', $categories);
        if (xtc_not_null($cPath)) {
            $cPath .= '_';
        }
        $cPath .= $category['categories_id'];
    }
    //BOF - Dokuman - 2009-10-02 - removed feature, due to wrong links in category on "last viewed"
    /*
      if($_SESSION['lastpath']!=''){
        $cPath = $_SESSION['lastpath'];
      }
    */
    //EOF - Dokuman - 2009-10-02 - removed feature, due to wrong links in category on "last viewed"
    return $cPath;
}
         $target = ' target="_blank"';
     } elseif ($imagesliders_data['imagesliders_url_target'] == '2') {
         $target = ' target="_top"';
     } elseif ($imagesliders_data['imagesliders_url_target'] == '3') {
         $target = ' target="_self"';
     } elseif ($imagesliders_data['imagesliders_url_target'] == '4') {
         $target = ' target="_parent"';
     }
     if ($imagesliders_data['imagesliders_url_typ'] == '0') {
         $url = $imagesliders_data['imagesliders_url'];
     } elseif ($imagesliders_data['imagesliders_url_typ'] == '1') {
         $url = xtc_href_link($imagesliders_data['imagesliders_url']);
     } elseif ($imagesliders_data['imagesliders_url_typ'] == '2') {
         $url = xtc_href_link(FILENAME_PRODUCT_INFO, xtc_product_link((int) $imagesliders_data['imagesliders_url'], xtc_get_products_name((int) $imagesliders_data['imagesliders_url'])));
     } elseif ($imagesliders_data['imagesliders_url_typ'] == '3') {
         $url = xtc_href_link(FILENAME_DEFAULT, xtc_category_link((int) $imagesliders_data['imagesliders_url'], xtc_get_categories_name((int) $imagesliders_data['imagesliders_url'])));
     } elseif ($imagesliders_data['imagesliders_url_typ'] == '4') {
         $content_querys = "SELECT content_title FROM " . TABLE_CONTENT_MANAGER . " WHERE languages_id='" . (int) $_SESSION['languages_id'] . "' and content_group = '" . (int) $imagesliders_data['imagesliders_url'] . "' and content_status=1 order by sort_order";
         $content_querys = xtDBquery($content_querys);
         $content_title = xtc_db_fetch_array($content_querys, true);
         $SEF = '';
         if (SEARCH_ENGINE_FRIENDLY_URLS == 'true') {
             $SEF = '&content=' . xtc_cleanName($content_title['content_title']);
         }
         $url = xtc_href_link(FILENAME_CONTENT, 'coID=' . (int) $imagesliders_data['imagesliders_url'] . $SEF);
     }
 }
 $imagesliders_data['imagesliders_image_url'] = DIR_WS_IMAGES . $imagesliders_data['imagesliders_image'];
 $imagesliders_data['imagesliders_image_url_link'] = $url;
 $imagesliders_data['imagesliders_image_url_target'] = $target;
 $imagesliders_array[] = $imagesliders_data;
                    $tax_query = xtc_db_query("select tax_rate from " . TABLE_TAX_RATES . " where tax_class_id = '" . $pInfo->products_tax_class_id . "' ");
                    $tax = xtc_db_fetch_array($tax_query);
                    $price = $price * ($tax[tax_rate] + 100) / 100;
                    $price_string = '' . TEXT_PRODUCTS_PRICE_INFO . '&nbsp;' . $currencies->format($price) . '<br/>' . TXT_NETTO . $currencies->format($price_netto);
                }
                $contents[] = array('text' => '<div style="padding-left: 30px;">' . $price_string . '</div><div style="padding-left: 30px;">' . TEXT_PRODUCTS_DISCOUNT_ALLOWED_INFO . '&nbsp;' . $pInfo->products_discount_allowed . ' %</div><div style="padding-left: 30px;">' . TEXT_PRODUCTS_QUANTITY_INFO . '&nbsp;' . $pInfo->products_quantity . '</div>');
                // END IN-SOLUTION
                //$contents[] = array('text' => '<br />' . TEXT_PRODUCTS_PRICE_INFO . ' ' . $currencies->format($pInfo->products_price) . '<br />' . TEXT_PRODUCTS_QUANTITY_INFO . ' ' . $pInfo->products_quantity);
                $contents[] = array('text' => '<div style="padding-left: 30px; padding-bottom: 10px;">' . TEXT_PRODUCTS_AVERAGE_RATING . ' ' . number_format($pInfo->average_rating, 2) . '</div>');
                $contents[] = array('text' => '<div style="padding-left: 30px; padding-bottom: 10px;">' . TEXT_PRODUCT_LINKED_TO . '<br />' . xtc_output_generated_category_path($pInfo->products_id, 'product') . '</div>');
                $contents[] = array('align' => 'center', 'text' => '<div style="padding: 10px;">' . xtc_product_thumb_image($pInfo->products_image, $pInfo->products_name) . '</div><div style="padding-bottom: 10px;">' . $pInfo->products_image . '</div>');
            }
        } else {
            // create category/product info
            $heading[] = array('text' => '<b>' . EMPTY_CATEGORY . '</b>');
            $contents[] = array('text' => sprintf(TEXT_NO_CHILD_CATEGORIES_OR_PRODUCTS, xtc_get_categories_name($current_category_id, $_SESSION['languages_id'])));
            $buttons_new_elements = '<br /><a class="btn btn-default" onclick="this.blur()" href="' . xtc_href_link(FILENAME_CATEGORIES, xtc_get_all_get_params(array('cPath', 'action', 'pID', 'cID')) . 'cPath=' . $cPath . '&action=new_category') . '">' . BUTTON_NEW_CATEGORIES . '</a>';
            if ($cPath != '0') {
                $buttons_new_elements .= '&nbsp;';
                $buttons_new_elements .= '<a class="btn btn-default" onclick="this.blur()" href="' . xtc_href_link(FILENAME_CATEGORIES, xtc_get_all_get_params(array('cPath', 'action', 'pID', 'cID')) . 'cPath=' . $cPath . '&action=new_product') . '">' . BUTTON_NEW_PRODUCTS . '</a><br /><br />';
            }
            $contents[] = array('align' => 'center', 'text' => $buttons_new_elements);
        }
        break;
}
//end switch
if (xtc_not_null($heading) && xtc_not_null($contents)) {
    //display info box
    echo '<div class="col-md-3 col-sm-12 col-xs-12 pull-right edit-box-class">' . "\n";
    echo box::infoBox($heading, $contents);
    // cYbercOsmOnauT - 2011-02-05 - Changed methods of the classes box and tableBox to static