Ich möchte die Produktempfehlungen als Slider in den Kategorieübersichten anzeigen... Leider konnte ich über die Suche keine Lösung finden - zumindest nicht für GX2... Wäre schön wenn mir jemand helfen könnte?
quick & dirty: - Ordner + Datei anlegen /user_classes/overloads/TopProductsMainContentView/MyTopProductsMainContentView.inc.php PHP: <?php class MyTopProductsMainContentView extends MyTopProductsMainContentView_parent { protected $customers_fsk18_display; protected $customers_status_id; protected $languages_id; protected $categorie_id; protected function set_validation_rules() { $this->validation_rules_array['customers_fsk18_display'] = array('type' => 'int'); $this->validation_rules_array['customers_status_id'] = array('type' => 'int'); $this->validation_rules_array['languages_id'] = array('type' => 'int'); $this->validation_rules_array['categorie_id'] = array('type' => 'int'); } protected function build_sql_query() { $t_fsk_lock = ''; if($this->customers_fsk18_display == 0) { $t_fsk_lock = ' AND p.products_fsk18 != 1'; } if(GROUP_CHECK == 'true') { $t_group_check = ' AND p.group_permission_' . $this->customers_status_id . ' = 1 '; } if($this->categorie_id != "") { $t_new_products_query = "SELECT p.products_id FROM " . TABLE_PRODUCTS . " p, products_to_categories c WHERE p.products_status = '1' AND p.products_startpage = '1' AND " . $t_group_check . " " . $t_fsk_lock . " p.products_id = c.products_id AND c.categories_id = " . $this->categorie_id . " ORDER BY p.products_startpage_sort ASC"; }else{ $t_new_products_query = "SELECT products_id FROM " . TABLE_PRODUCTS . " p WHERE p.products_status = '1' AND p.products_startpage = '1' " . $t_group_check . " " . $t_fsk_lock . " ORDER BY p.products_startpage_sort ASC"; } return $t_new_products_query; } } in der templates/TEMPLATENAME/module/product_listing/product_listing_v1.html folgendes an gewünschte Stelle setzen: PHP: {php} if (isset($_GET['cPath'])) { $cPath = xtc_input_validation($_GET['cPath'], 'cPath', ''); } else { $cPath = ''; } if (xtc_not_null($cPath)) { $cPath_array = xtc_parse_category_path($cPath); $cPath = implode('_', $cPath_array); $current_category_id = $cPath_array[(sizeof($cPath_array) - 1)]; } else { $current_category_id = 0; } $coo_top_products_content_view2 = MainFactory::create_object('TopProductsMainContentView'); $coo_top_products_content_view2->set_('customers_fsk18_display', $_SESSION['customers_status']['customers_fsk18_display']); $coo_top_products_content_view2->set_('customers_status_id', $_SESSION['customers_status']['customers_status_id']); $coo_top_products_content_view2->set_('languages_id', $_SESSION['languages_id']); $coo_top_products_content_view2->set_('categorie_id', $current_category_id); $module_content_top = $coo_top_products_content_view2->get_html(); echo $module_content_top; {/php} Nun werden in den Kategorieübersichten die Empfehlungen abhängig von der gewählten Kategorie angezeit... Wie gesagt, nicht ganz sauber - aber es funktioniert...
Hallo Seba, zunächst danke für die Lösung. Bitte schreibe die Codes doch in eine Code-Box, dann ist es besser zu lesen und das Programm fügt keine Leerzeichen ein. Die Icons für Code-Boxen findest Du über dem Textfeld.