Einfügen eines Links zur Kategorie unter Produktseite – Veyton

templates\my theme\xtCore\pages\product\product.html

in Form:

kuenstler_title (Katgorie erste Ebene): kuenstler_name (Kategorie 2 Ebene.)

{php}

global $db,$language;
$products_id = $this->get_template_vars(‘products_id’);
$kuenstler_name = $this->get_template_vars(‘name_kuenstler’);

$kuenstler_cat = & new category(1);
$kuenstler_title = $kuenstler_cat->current_category_data[‘categories_name’];

$query = “SELECT * FROM `”.DB_PREFIX.”_products_to_categories` WHERE products_id = “. $products_id;

$rs = $db->Execute($query);
if ($rs->RecordCount() > 0) {
while (!$rs->EOF) {
$cat_id = intval($rs->fields[‘categories_id’]);
$cat = & new category($cat_id);
if ($cat->current_category_data[‘parent_id’] == 1) {
echo $kuenstler_title.': ‘.'<a href=”/’.$cat->current_category_data[‘url_text’].'”>’.$kuenstler_name.'</a>';
}

$rs->MoveNext();

}
}

{/php}

Leave a Reply

Your email address will not be published. Required fields are marked *


3 + = ten

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>