|
||||
|
der bildpfad des kategorie bildes steht auch diesem template zur verf?gung.
{$CATEGORIES_IMAGE} in der product_listing.php aber noch folgende zeile ?ndern. Code:
$module_smarty->assign('CATEGORIES_IMAGE',DIR_WS_IMAGES.$category['categories_image']);
__________________
xt:Commerce Helpdesk xt:Commerce Blog xt:Commerce Warenwirtschaft ### ![]() Offene Stellen bei xt:Commerce! xt:Commerce stellt ein ### |
|
|||
|
{$CATEGORIES_NAME} = KatName
{$CATEGORIES_IMAGE} = KatBild ist ok, habe ich eingef?gt. Wo genau soll ich den Code Code:
$module_smarty->assign('CATEGORIES_IMAGE',DIR_WS_IMAGES.$category['categories_image']);
Die produkt-listing ist eine html datei. Wenn ich den php-Tag dort ?ndere/einf?ge, was muss noch ge?ndert werden. Eisrolle |
|
||||
|
Zitat:
__________________
xt:Commerce Helpdesk xt:Commerce Blog xt:Commerce Warenwirtschaft ### ![]() Offene Stellen bei xt:Commerce! xt:Commerce stellt ein ### |
|
|||
|
Besten Dank f?r die schnellen Antworten. Geht aber dennoch nicht.
Habe Code Code:
$module_smarty->assign('CATEGORIES_IMAGE',DIR_WS_IMAGES.$category['categories_image']);
und {$CATEGORIES_NAME} {$CATEGORIES_IMAGE} in templates/xtc/module/product_listingv1.html eingef?gt. Keine Anzeige von Name oder Bild der letzten Unterkategorie in Produktliste. Eisrolle |
|
||||
|
also, der kategorie namen der aktuellen kategorie wird standartm??ig ober dem produkt listing hingeschrieben.
willst du etwa was anders ?
__________________
xt:Commerce Helpdesk xt:Commerce Blog xt:Commerce Warenwirtschaft ### ![]() Offene Stellen bei xt:Commerce! xt:Commerce stellt ein ### |
|
|||
|
Genau das meine ich, blo? das macht es nicht im Hauptmen?. (nur im {$navtrail})
Auch bei keinem anderen xtc-Shop. Wenn ich Unterkategorien einrichte wird beim Aufrufen dieser die ?bergeordnete Kategorie mit ?berschrift und Bild im Hauptmen? mit angezeigt. Wenn ich die letzte Unterkategorie aufrufe, kommt die Produktliste. In dieser m?chte ich gern auch oben im Hauptmen? den Namen und das Bild der aufgerufenen Kategorie (wird in Navi fett angezeigt) abgebildet haben, macht es nicht standardm??ig. Es werden nur die Produkte aufgelistet. Habe daf?r {$CATEGORIES_NAME} {$CATEGORIES_IMAGE} in product_listingv1.html eingef?gt. Geht aber nicht. |
|
||||
|
achso, in der 010104 war das noch nicht drinnen, in der aktuellen version wurde das behoben.
hier die aktuellen files, die unterschiede kannst du dir bitte selbst raussuchen. Code:
<?php /* ----------------------------------------------------------------------------------------- $Id: default.php,v 1.17 2004/02/13 12:25:15 fanta2k Exp $ XT-Commerce - community made shopping http://www.xt-commerce.com Copyright (c) 2003 XT-Commerce ----------------------------------------------------------------------------------------- based on: (c) 2000-2001 The Exchange Project (earlier name of osCommerce) (c) 2002-2003 osCommerce(default.php,v 1.84 2003/05/07); www.oscommerce.com (c) 2003 nextcommerce (default.php,v 1.11 2003/08/22); www.nextcommerce.org Released under the GNU General Public License ----------------------------------------------------------------------------------------- Third Party contributions: Enable_Disable_Categories 1.3 Autor: Mikel Williams | mikel@ladykatcostumes.com Customers Status v3.x (c) 2002-2003 Copyright Elari elari@free.fr | www.unlockgsm.com/dload-osc/ | CVS : http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/elari/?sortby=date#dirlist Released under the GNU General Public License ---------------------------------------------------------------------------------------*/ $default_smarty = new smarty; $default_smarty->assign('tpl_path','templates/'.CURRENT_TEMPLATE.'/'); $default_smarty->assign('session',session_id()); $main_content = ''; // include needed functions require_once(DIR_FS_INC . 'xtc_customer_greeting.inc.php'); require_once(DIR_FS_INC . 'xtc_get_path.inc.php'); require_once(DIR_FS_INC . 'xtc_draw_hidden_field.inc.php'); if ($category_depth == 'nested') { $category_query = xtc_db_query("select cd.categories_description,cd.categories_name, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . $current_category_id . "' and cd.categories_id = '" . $current_category_id . "' and cd.language_id = '" . (int)$_SESSION['languages_id'] . "'"); $category = xtc_db_fetch_array($category_query); if (isset($cPath) && ereg('_', $cPath)) { // check to see if there are deeper categories within the current category $category_links = array_reverse($cPath_array); for($i = 0, $n = sizeof($category_links); $i < $n; $i++) { $categories_query = xtc_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_status = '1' and c.parent_id = '" . $category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$_SESSION['languages_id'] . "' order by sort_order, cd.categories_name"); if (xtc_db_num_rows($categories_query) < 1) { // do nothing, go through the loop } else { break; // we've found the deepest category the customer is in } } } else { $categories_query = xtc_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_status = '1' and c.parent_id = '" . $current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$_SESSION['languages_id'] . "' order by sort_order, cd.categories_name"); } $rows = 0; while ($categories = xtc_db_fetch_array($categories_query)) { $rows++; $cPath_new = xtc_get_path($categories['categories_id']); $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%'; $image=''; if ($categories['categories_image']!='') { $image=DIR_WS_IMAGES.'categories/'.$categories['categories_image']; } $categories_content[]=array( 'CATEGORIES_NAME' => $categories['categories_name'], 'CATEGORIES_IMAGE' => $image, 'CATEGORIES_LINK' => xtc_href_link(FILENAME_DEFAULT, $cPath_new), 'CATEGORIES_DESCRIPTION' => $categories['categories_description']); } $new_products_category_id = $current_category_id; include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); $image=''; if ($category['categories_image']!='') { $image=DIR_WS_IMAGES.'categories/'.$category['categories_image']; } $default_smarty->assign('CATEGORIES_NAME',$category['categories_name']); $default_smarty->assign('CATEGORIES_IMAGE',$image); $default_smarty->assign('CATEGORIES_DESCRIPTION',$category['categories_description']); $default_smarty->assign('language', $_SESSION['language']); $default_smarty->assign('module_content',$categories_content); $default_smarty->caching = 0; $main_content= $default_smarty->fetch(CURRENT_TEMPLATE.'/module/categorie_listing/categorie_listing.html'); $smarty->assign('main_content',$main_content); } elseif ($category_depth == 'products' || $_GET['manufacturers_id']) { //fsk18 lock $fsk_lock=''; if ($_SESSION['customers_status']['customers_fsk18_display']=='0') { $fsk_lock=' and p.products_fsk18!=1'; } // show the products of a specified manufacturer if (isset($_GET['manufacturers_id'])) { if (isset($_GET['filter_id']) && xtc_not_null($_GET['filter_id'])) { // We are asked to show only a specific category $listing_sql = "select p.products_fsk18,p.products_model, pd.products_name, m.manufacturers_name, p.products_quantity, p.products_image, p.products_weight, pd.products_short_description, pd.products_description, p.products_id, p.manufacturers_id, p.products_price, p.products_discount_allowed, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$_SESSION['languages_id'] . "' ".$fsk_lock." and p2c.categories_id = '" . (int)$_GET['filter_id'] . "'"; } else { // We show them all $listing_sql = "select p.products_fsk18,p.products_model, pd.products_name, m.manufacturers_name, p.products_quantity, p.products_image, p.products_weight, pd.products_short_description, pd.products_description, p.products_id, p.manufacturers_id, p.products_price, p.products_discount_allowed, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$_SESSION['languages_id'] . "' and p.manufacturers_id = m.manufacturers_id ".$fsk_lock." and m.manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "'"; } } else { // show the products in a given categorie if (isset($_GET['filter_id']) && xtc_not_null($_GET['filter_id'])) { // We are asked to show only specific catgeory $listing_sql = "select p.products_fsk18,p.products_model, pd.products_name, m.manufacturers_name, p.products_quantity, p.products_image, p.products_weight, pd.products_short_description, pd.products_description, p.products_id, p.manufacturers_id, p.products_price, p.products_discount_allowed, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$_GET['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$_SESSION['languages_id'] . "' ".$fsk_lock." and p2c.categories_id = '" . $current_category_id . "'"; } else { // We show them all $listing_sql = "select p.products_fsk18,p.products_model, pd.products_name, m.manufacturers_name, p.products_quantity, p.products_image, p.products_weight, pd.products_short_description, pd.products_description, p.products_id, p.manufacturers_id, p.products_price, p.products_discount_allowed, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$_SESSION['languages_id'] . "' ".$fsk_lock." and p2c.categories_id = '" . $current_category_id . "'"; } } // optional Product List Filter if (PRODUCT_LIST_FILTER > 0) { if (isset($_GET['manufacturers_id'])) { $filterlist_sql = "select distinct c.categories_id as id, cd.categories_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = cd.categories_id and cd.language_id = '" . (int)$_SESSION['languages_id'] . "' and p.manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "' order by cd.categories_name"; } else { $filterlist_sql = "select distinct m.manufacturers_id as id, m.manufacturers_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and p2c.categories_id = '" . $current_category_id . "' order by m.manufacturers_name"; } $filterlist_query = xtc_db_query($filterlist_sql); if (xtc_db_num_rows($filterlist_query) > 1) { $manufacturer_dropdown= xtc_draw_form('filter', FILENAME_DEFAULT, 'GET') .''; if (isset($_GET['manufacturers_id'])) { $manufacturer_dropdown.= xtc_draw_hidden_field('manufacturers_id', $_GET['manufacturers_id']); $options = array(array('text' => TEXT_ALL_CATEGORIES)); } else { $manufacturer_dropdown.= xtc_draw_hidden_field('cPath', $cPath); $options = array(array('text' => TEXT_ALL_MANUFACTURERS)); } $manufacturer_dropdown.= xtc_draw_hidden_field('sort', $_GET['sort']); while ($filterlist = xtc_db_fetch_array($filterlist_query)) { $options[] = array('id' => $filterlist['id'], 'text' => $filterlist['name']); } $manufacturer_dropdown.= xtc_draw_pull_down_menu('filter_id', $options, $_GET['filter_id'], 'onchange="this.form.submit()"'); $manufacturer_dropdown.= '</form>' . "\n"; } } // Get the right image for the top-right $image = DIR_WS_IMAGES . 'table_background_list.gif'; if (isset($_GET['manufacturers_id'])) { $image = xtc_db_query("select manufacturers_image from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "'"); $image = xtc_db_fetch_array($image); $image = $image['manufacturers_image']; } elseif ($current_category_id) { $image = xtc_db_query("select categories_image from " . TABLE_CATEGORIES . " where categories_id = '" . $current_category_id . "'"); $image = xtc_db_fetch_array($image); $image = $image['categories_image']; } include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING); } else { // default page $shop_content_query=xtc_db_query("SELECT content_title, content_heading, content_text, content_file FROM ".TABLE_CONTENT_MANAGER." WHERE content_group='5' AND languages_id='".$_SESSION['languages_id']."'"); $shop_content_data=xtc_db_fetch_array($shop_content_query); $default_smarty->assign('title',$shop_content_data['content_heading']); include(DIR_WS_INCLUDES . FILENAME_CENTER_MODULES); $default_smarty->assign('text',str_replace('{$greeting}',xtc_customer_greeting(),$shop_content_data['content_text'])); $default_smarty->assign('language', $_SESSION['language']); // set cache ID if (USE_CACHE=='false') { $default_smarty->caching = 0; $main_content= $default_smarty->fetch(CURRENT_TEMPLATE.'/module/main_content.html'); } else { $default_smarty->caching = 1; $default_smarty->cache_lifetime=CACHE_LIFETIME; $default_smarty->cache_modified_check=CACHE_CHECK; $cache_id = $_SESSION['language'].$_SESSION['currency'].$_SESSION['customer_id']; $main_content= $default_smarty->fetch(CURRENT_TEMPLATE.'/module/main_content.html',$cache_id); } $smarty->assign('main_content',$main_content); } ?> Code:
<?php /* ----------------------------------------------------------------------------------------- $Id: product_listing.php,v 1.16 2004/02/12 12:27:04 fanta2k Exp $ XT-Commerce - community made shopping http://www.xt-commerce.com Copyright (c) 2003 XT-Commerce ----------------------------------------------------------------------------------------- based on: (c) 2000-2001 The Exchange Project (earlier name of osCommerce) (c) 2002-2003 osCommerce(product_listing.php,v 1.42 2003/05/27); www.oscommerce.com (c) 2003 nextcommerce (product_listing.php,v 1.19 2003/08/1); www.nextcommerce.org Released under the GNU General Public License ---------------------------------------------------------------------------------------*/ $module_smarty= new Smarty; $module_smarty->assign('tpl_path','templates/'.CURRENT_TEMPLATE.'/'); // include needed functions require_once(DIR_FS_INC . 'xtc_get_products_price.inc.php'); require_once(DIR_FS_INC . 'xtc_get_all_get_params.inc.php'); require_once(DIR_FS_INC . 'xtc_image_button.inc.php'); $listing_split = new splitPageResults($listing_sql, $_GET['page'], MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id'); $module_content=array(); if ($listing_split->number_of_rows > 0) { $rows = 0; $listing_query = xtc_db_query($listing_split->sql_query); while ($listing = xtc_db_fetch_array($listing_query)) { $rows++; if ($_SESSION['customers_status']['customers_status_show_price'] != '0') { $price=xtc_get_products_price($listing['products_id'], $price_special=1, $quantity=1); $buy_now=''; if ($_SESSION['customers_status']['customers_fsk18']=='1') { if ($listing['products_fsk18']=='0') $buy_now='<a href="' . xtc_href_link(basename($PHP_SELF), xtc_get_all_get_params(array('action')) . 'action=buy_now&BUYproducts_id=' . $listing['products_id'], 'NONSSL') . '">' . xtc_image_button('button_buy_now.gif', TEXT_BUY . $listing['products_name'] . TEXT_NOW); } else { $buy_now='<a href="' . xtc_href_link(basename($PHP_SELF), xtc_get_all_get_params(array('action')) . 'action=buy_now&BUYproducts_id=' . $listing['products_id'], 'NONSSL') . '">' . xtc_image_button('button_buy_now.gif', TEXT_BUY . $listing['products_name'] . TEXT_NOW); } $fsk18=''; if ($listing['products_fsk18']=='1') { $fsk18='true'; } } $image=''; if ($listing['products_image']!='') { $image=DIR_WS_THUMBNAIL_IMAGES . $listing['products_image']; } $module_content[]=array( 'PRODUCTS_NAME'=>$listing['products_name'], 'PRODUCTS_SHORT_DESCRIPTION'=>$listing['products_short_description'], 'PRODUCTS_IMAGE'=>$image, 'PRODUCTS_PRICE'=>$price, 'PRODUCTS_LINK' =>xtc_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing['products_id']), 'BUTTON_BUY_NOW'=>$buy_now, 'PRODUCTS_FSK18' => $fsk18, 'PRODUCTS_ID'=>$listing['products_id']); } } if ($listing_split->number_of_rows > 0) { $navigation=' <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="smallText">'.$listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS).'</td> <td class="smallText" align="right">'.TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, xtc_get_all_get_params(array('page', 'info', 'x', 'y'))).'</td> </tr> </table>'; $category_query = xtc_db_query("select cd.categories_description,cd.categories_name, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . $current_category_id . "' and cd.categories_id = '" . $current_category_id . "' and cd.language_id = '" . $_SESSION['languages_id'] . "'"); $category = xtc_db_fetch_array($category_query); $module_smarty->assign('CATEGORIES_NAME',$category['categories_name']); $module_smarty->assign('CATEGORIES_IMAGE',DIR_WS_IMAGES.'categories/'.$category['categories_image']); $module_smarty->assign('CATEGORIES_DESCRIPTION',$category['categories_description']); } else { $module_smarty->assign('result','false'); } $module_smarty->assign('MANUFACTURER_DROPDOWN',$manufacturer_dropdown); $module_smarty->assign('language', $_SESSION['language']); $module_smarty->assign('module_content',$module_content); $module_smarty->assign('NAVIGATION',$navigation); // set cache ID if (USE_CACHE=='false') { $module_smarty->caching = 0; $module= $module_smarty->fetch(CURRENT_TEMPLATE.'/module/product_listing/product_listing_v1.html'); } else { $module_smarty->caching = 1; $module_smarty->cache_lifetime=CACHE_LIFETIME; $module_smarty->cache_modified_check=CACHE_CHECK; $cache_id = $_GET['cPath'].$_SESSION['language'].$_SESSION['customers_status']['customers_status_name'].$_SESSION['currency'].$_GET['manufacturers_id'].$_GET['filter_id']; $module= $module_smarty->fetch(CURRENT_TEMPLATE.'/module/product_listing/product_listing_v1.html',$cache_id); } $smarty->assign('main_content',$module); ?>
__________________
xt:Commerce Helpdesk xt:Commerce Blog xt:Commerce Warenwirtschaft ### ![]() Offene Stellen bei xt:Commerce! xt:Commerce stellt ein ### |
|
|||
|
Auf Anfrage hier die L?sung:
In includes/modules/default.php nichts ge?ndert in includes/modules/product_listing.php in Zeile 59 folgendes eingef?gt: Code:
$category_query = xtc_db_query("select cd.categories_description,cd.categories_name, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . $current_category_id . "' and cd.categories_id = '" . $current_category_id . "' and cd.language_id = '" . $_SESSION['languages_id'] . "'");
$category = xtc_db_fetch_array($category_query);
$module_smarty->assign('CATEGORIES_NAME',$category['categories_name']);
$module_smarty->assign('CATEGORIES_IMAGE',DIR_WS_IMAGES.$category['categories_image']);
Code:
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top">
<td><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong><font color="#666666" size="4">{$CATEGORIES_NAME}</font></strong>
</font></td>
<td align="right"><img src="{$CATEGORIES_IMAGE}"></td>
</tr>
</table>
|
![]() |
| Lesezeichen |
| Stichworte |
| kategorien, produkt |
| Themen-Optionen | |
| Ansicht | |
|
|