Hallo, ich habe folgendes Problem: bisher (Shopversion 2,4) konnte man in der Listenansicht Attribute anzeigen lassen und trotzdem wurden ein "ab" vor dem günstigsten Preis angezeigt. In der Version 3.2.x geht das leider nicht mehr. Das "ab" erscheint nur, wenn die Anzeige in der Listenansicht deaktiviert ist. Es soll aber beides angezeigt werden. Ich habe bisher nur geschafft das "ab" bei allen Attributen angezeigt bekommen (auch bei dem teuersten Attribut) Da das auch in der Artikel-Detailseite steht, ist das eher ungünstig. Hat jemand eine Idee, wie man das hinbekommen könnte?
Mein Beileid Barbara btw ich such ne Lösung um bei "Ab-Preisen" die niedrigste Staffelpreismöglichkeit anzeigen zu lassen. Bisher zeigt er bei Produkten die Staffelpreise besitzen, stets nur den Grundpreis für ein Produkt an. Also 1 Stk = 1,89 € 500 Stk = 1,59 € Dann will ich, dass da "ab 1,59 €" steht. Danke dir und viel Glück weiterhin
wie war das mit dem geteilten Leid? Blöd ist, dass es in der 2.4 funktionierte, von Gambio aber geändert wurde. Nur weil man es in der Listenansicht auswählen könnte, wird auch in der Kachelansicht das "ab" nicht mehr angezeigt. Dann werde ich mal weiter suchen...
Jetzt habe ich einfach mal in der Datei templates/ Honeygrid/ snippets/ product_listing/ product.html ein "ab" vor den Preis geschrieben: Code: div class="price"> <span class="current-price-container"{if $p_meta} title="{$p_meta}"{/if}> ab {$p_price}{if $p_vpe}<br /><span class="gm_products_vpe products-vpe">{$p_vpe}</span>{/if} </span> </div> Das steht jetzt überall in der Listen- und Kachelansicht vor dem Preis-Block - nur nicht da, wo ich Attribute in der Listenansicht aktiviert habe
mies :/ lass uns wissen, wenn du ne lösung gefunden hast. ich drück dir die daumen. ps.: liest denn keiner von gambio hier mit ?? ;P
Gibt es schon was NEUES? Insgesamt wäre es toll wenn man insgesamt "ab" Preis bei einzelnen Produkten hinzufügen könnte. Und das mit den Staffelpreisen wäre perfekt.
Der "ab" Preis wird in der Datei "Honeygrid/snippets/product_listing/product.html" durch: HTML: <form {if (!$p_attributes && !$p_graduated_prices && $qty_value == '1') || !$p_by_now || !$p_qty_gm} class="no-status-check"{/if}> kontrolliert. Um bei den Artikeln mit Attributen den "ab" Preis zeigen zu lassen, muss man die Ausrufezeichen, die vor "$p_attributes" steht entfernen: HTML: <form {if ($p_attributes && !$p_graduated_prices && $qty_value == '1') || !$p_by_now || !$p_qty_gm} class="no-status-check"{/if}> Außerdem muss man weiter unten den Code: HTML: <span class="current-price-container"{if $p_meta} title="{$p_meta}"{/if}> {$p_price}{if $p_vpe}<br /><span class="gm_products_vpe products-vpe">{$p_vpe}</span>{/if} </span> folgendermassen ergänzen: HTML: {if $p_attributes == true} <span class="current-price-container"{if $p_meta} title="{$p_meta}"{/if}> ab {$p_price}{if $p_vpe}<br /><span class="gm_products_vpe products-vpe">{$p_vpe}</span>{/if} </span> {else} <span class="current-price-container"{if $p_meta} title="{$p_meta}"{/if}> {$p_price}{if $p_vpe}<br /><span class="gm_products_vpe products-vpe">{$p_vpe}</span>{/if} </span> {/if} Dann sollte es eigentlich funktionieren. Wie immer ohne Gewähr.
Hallo Cyrus, jetzt habe ich eine Beule vom auf die Tischplatte klatschen! Da suche ich die Dateien durch und schiebe die Codes hin und her und dann ist es nur ein "!" . Das zeigt mir mal wieder, wie viel ich noch zu lernen habe Der Code ist im Testshop eingefügt und funktioniert so wie er soll. Zumindest konnte ich bisher nichts negatives feststellen. Vielen lieben Dank dafür.
Es gibt doch noch ein Problem: wenn man Angebote hat, steht da ab statt X,XX € nur Y,YY € da müsste das "ab" vor dem "nur" stehen. Nachtrag, es sind keine Angebote, sondern Artikel-Rabatte.
Hallo barbara, sorry, da ich im Test-Shop keine Angebotspreise hatte, ist das Problem mir nicht aufgefallen. Ich habe die Aufbau der Specials-Template mir angeschaut. Da die Produkte, die im Angebot sind das selbe Template benutzen wie die normale Produkte, oder Produkte mit Attributes, wird es schwierig diese in der HTML-Datei von einander zu unterscheiden. Evtl. muss man über JS oder PHP als "Overload" die Unterscheidung einfügen. Bei Gelegenheit werde ich mir das genauer anschauen.
Hallo barbara, probiere mal dies: mach die Ausrufezeichen von der Datei "Honeygrid/snippets/product_listing/product.html" weg. HTML: <form {if ($p_attributes && !$p_graduated_prices && $qty_value == '1') || !$p_by_now || !$p_qty_gm} class="no-status-check"{/if}> schreibe einen Overload in dem Ordner: "GXUserComponents/overloads/ProductListingContentControl/abPrice_ProductListingContentControl.inc.php" PHP: <?phpclass abPrice_ProductListingContentControl extends abPrice_ProductListingContentControl_parent{ public function proceed($p_action = 'default') { $t_html_output = ''; $t_uninitialized_array = $this->get_uninitialized_variables(array('coo_product', 'current_category_id', 'current_page', 'customers_status_id', 'languages_id', )); if(empty($t_uninitialized_array)) { switch($p_action) { case 'search_result': $this->build_search_result_sql(); break; default: if(xtc_check_categories_status($this->current_category_id) >= 1) { $this->v_output_buffer = $this->get_error_html_output(CATEGORIE_NOT_FOUND); return true; } $this->init_feature_filter(); $t_category_depth = $this->determine_category_depth(); switch($t_category_depth) { case 'top': // start page $this->v_output_buffer = $this->get_start_page_html_output(); return true; break; case 'nested': $t_html_output = $this->get_category_listing_html_output(); // no break; default: $this->build_sql_query(); } } $this->extend_proceed($p_action); if(empty($this->sql_query)) { return true; } $t_max_display_search_results = $this->determine_max_display_search_results(); // save last listing query for ProductNavigator ($_SESSION['last_listing_sql']) $this->last_listing_sql = $this->sql_query; $coo_listing_split = new splitPageResults($this->sql_query, $this->page_number, $t_max_display_search_results, 'p.products_id'); $t_products_array = array(); if($coo_listing_split->number_of_rows > 0) { $t_category_data_array = $this->get_category_data_array(); $t_category_name = $t_category_data_array['name']; $t_category_heading_title = $t_category_data_array['heading_title']; $t_category_image_alt_text = $t_category_data_array['image_alt_text']; $t_category_image = $t_category_data_array['image']; $t_categories_description = $t_category_data_array['description']; $t_show_quantity = $t_category_data_array['show_quantity']; $t_category_show_quantity = $t_category_data_array['category_show_quantity']; $coo_navigation_view = MainFactory::create_object('SplitNavigationContentView'); $coo_navigation_view->set_('coo_split_page_results', $coo_listing_split); $t_navigation_html = $coo_navigation_view->get_html(); $t_rows_count = 0; $t_query = $coo_listing_split->sql_query; $t_result = xtc_db_query($t_query); while($t_product_array = xtc_db_fetch_array($t_result)) { $t_rows_count++; // check if product has properties $t_query = 'SELECT COUNT(*) AS count FROM products_properties_combis WHERE products_id = ' . $t_product_array['products_id']; $t_combis_result = xtc_db_query($t_query); $t_count_combis_array = xtc_db_fetch_array($t_combis_result); if($t_count_combis_array['count'] > 0) { $t_product_has_properties = true; } else { $t_product_has_properties = false; } $GLOBALS['xtPrice']->showFrom_Attributes = true; if(((gm_get_conf('MAIN_SHOW_ATTRIBUTES') == 'true' && isset($t_category_data_array['gm_show_attributes']) == false) || $t_category_data_array['gm_show_attributes'] == '1') && $t_product_has_properties == false ) { //LeGong CHANGED VALUE FROM "false" TO "true" TO SHOW THE "FROM PRICE" BY PRODUCT LISTING $GLOBALS['xtPrice']->showFrom_Attributes =true; } $t_products_array[] = $this->coo_product->buildDataArray($t_product_array); $coo_product = new product($t_product_array['products_id']); $t_attributes_html = ''; if(((gm_get_conf('MAIN_SHOW_ATTRIBUTES') == 'true' && isset($t_category_data_array['gm_show_attributes']) == false) || $t_category_data_array['gm_show_attributes'] == '1') && $t_product_has_properties == false ) { // CREATE ProductAttributesContentView OBJECT $coo_product_attributes = MainFactory::create_object('ProductAttributesContentView'); // SET TEMPLATE $t_filepath = DIR_FS_CATALOG . 'templates/' . CURRENT_TEMPLATE . '/module/gm_product_options/'; $c_template = $coo_product_attributes->get_default_template($t_filepath, $coo_product->data['gm_options_template']); $coo_product_attributes->set_content_template('module/gm_product_options/' . $c_template); // SET DATA $coo_product_attributes->set_coo_product($coo_product); $coo_product_attributes->set_language_id($_SESSION['languages_id']); // GET HTML $t_attributes_html = $coo_product_attributes->get_html(); } $t_graduated_prices_html = ''; if($t_category_data_array['show_graduated_prices']) { $coo_graduated_prices = MainFactory::create_object('GraduatedPricesContentView'); $coo_graduated_prices->set_coo_product($coo_product); $coo_graduated_prices->set_customers_status_graduated_prices($_SESSION['customers_status']['customers_status_graduated_prices']); $coo_graduated_prices->set_content_template('module/gm_graduated_price.html'); $t_graduated_prices_html = $coo_graduated_prices->get_html(); } if(xtc_has_product_attributes($t_product_array['products_id'])) { $gm_has_attributes = 1; } else { $gm_has_attributes = 0; } $t_products_array[sizeof($t_products_array) - 1] = array_merge($t_products_array[sizeof($t_products_array) - 1], array('GM_ATTRIBUTES' => $t_attributes_html, 'GM_GRADUATED_PRICES' => $t_graduated_prices_html, 'GM_HAS_ATTRIBUTES' => $gm_has_attributes )); if(empty($coo_product->data['quantity_unit_id']) == false && (!$t_product_has_properties || ($t_product_has_properties && $coo_product->data['use_properties_combis_quantity'] == '0')) ) { $t_products_array[sizeof($t_products_array) - 1] = array_merge($t_products_array[sizeof($t_products_array) - 1], array('UNIT' => $coo_product->data['unit_name'])); } if($t_category_show_quantity) { if(empty($coo_product->data['gm_show_qty_info']) == false && (!$t_product_has_properties || ($t_product_has_properties && $coo_product->data['use_properties_combis_quantity'] == '0')) ) { $t_products_array[sizeof($t_products_array) - 1] = array_merge($t_products_array[sizeof($t_products_array) - 1], array('PRODUCTS_QUANTITY' => $coo_product->data['products_quantity'])); } } if($t_product_has_properties) { $t_products_array[sizeof($t_products_array) - 1]['SHOW_PRODUCTS_WEIGHT'] = 0; } $t_products_array[sizeof($t_products_array) - 1] = array_merge($t_products_array[sizeof($t_products_array) - 1], array('ABROAD_SHIPPING_INFO_LINK' => main::get_abroad_shipping_info_link())); $this->add_product_data($t_products_array, $t_product_array, $coo_product); unset($products_options_data); } if(isset($t_category_data_array['view_mode_tiled'])) { $t_view_mode = $this->determine_view_mode($t_category_data_array['view_mode_tiled']); } else { $t_view_mode = $this->determine_view_mode(); } $this->build_cache_id_parameter_array(array($t_view_mode)); $coo_product_listing_view = MainFactory::create_object('ProductListingContentView', array($t_category_data_array['listing_template'])); $coo_product_listing_view->set_('cache_id_parameter_array', $this->cache_id_parameter_array); $coo_product_listing_view->set_('category_description', $t_categories_description); $coo_product_listing_view->set_('category_heading_title', $t_category_heading_title); $coo_product_listing_view->set_('category_image_alt_text', $t_category_image_alt_text); $coo_product_listing_view->set_('category_image', $t_category_image); $coo_product_listing_view->set_('category_name', $t_category_name); if(isset($this->filter_selection_html)) { $coo_product_listing_view->set_('filter_selection_html', $this->filter_selection_html); } // De-duplicate multidimensional array (@link http://stackoverflow.com/a/946300) $t_hidden_get_params_array = array_map('unserialize', array_unique(array_map('serialize', $this->build_hidden_get_params_array()))); $coo_product_listing_view->set_('get_params_hidden_data_array', array_values($t_hidden_get_params_array)); if(isset($this->listing_count)) { $coo_product_listing_view->set_('listing_count', $this->listing_count); } if(isset($this->listing_sort)) { $coo_product_listing_view->set_('listing_sort', $this->listing_sort); } if(isset($this->manufacturers_id)) { $coo_product_listing_view->set_('manufacturers_id', $this->manufacturers_id); } if(isset($this->manufacturers_data_array)) { $coo_product_listing_view->set_('manufacturers_data_array', $this->manufacturers_data_array); } if(isset($this->manufacturers_dropdown)) { $coo_product_listing_view->set_('manufacturers_dropdown', $this->manufacturers_dropdown); } $coo_product_listing_view->set_('navigation_html', $t_navigation_html); $coo_product_listing_view->set_('navigation_info_html', $coo_listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS)); $coo_product_listing_view->set_('products_array', $t_products_array); $coo_product_listing_view->set_('products_per_page', (int)MAX_DISPLAY_SEARCH_RESULTS); if(isset($this->search_keywords)) { $coo_product_listing_view->set_('search_keywords', $this->search_keywords); } $coo_product_listing_view->set_('show_quantity', $t_show_quantity); $coo_product_listing_view->set_('thumbnail_width', PRODUCT_IMAGE_THUMBNAIL_WIDTH + 10); $t_page_url_array = explode('?', gm_get_env_info('REQUEST_URI')); $coo_product_listing_view->set_('sorting_form_action_url', $t_page_url_array[0]); $coo_product_listing_view->set_('view_mode', $t_view_mode); $coo_product_listing_view->set_('view_mode_url_default', $this->build_view_mode_url('default')); $coo_product_listing_view->set_('view_mode_url_tiled', $this->build_view_mode_url('tiled')); $showRating = false; if(gm_get_conf('ENABLE_RATING') === 'true' && gm_get_conf('SHOW_RATING_IN_GRID_AND_LISTING') === 'true') { $showRating = true; } $coo_product_listing_view->set_('showRating', $showRating); $coo_product_listing_view->set_('showManufacturerImages', gm_get_conf('SHOW_MANUFACTURER_IMAGE_LISTING')); $coo_product_listing_view->set_('showProductRibbons', gm_get_conf('SHOW_PRODUCT_RIBBONS')); if($this->productListingTemplatePath !== null) { $t_html_output = ''; $coo_product_listing_view->set_content_template($this->productListingTemplatePath); } $t_html_output .= $coo_product_listing_view->get_html(); } elseif(GM_CAT_COUNT == 0) // GM_CAT_COUNT > 0: products FALSE, sub-categories TRUE { $t_html_output = $this->get_error_html_output(TEXT_PRODUCT_NOT_FOUND); } } else { trigger_error("Variable(s) " . implode(', ', $t_uninitialized_array) . " do(es) not exist in class " . get_class($this) . " or is/are null", E_USER_ERROR); } $this->v_output_buffer = $t_html_output; parent::proceed($p_action); }} Caches leeren und testen. Wie immer ohne Gewähr
Hallo Cyrus, Gerade im Testshop eingefügt und funktioniert perfekt. ich kann leider immer nur ein Danke Klicken, sonnst wären da viiiiel mehr
Hallo barbara, ich versuche nur ein Teil von meinen Schulden zurück zu zahlen. Ich habe hier im Forum viel von dir und ein Paar anderen netten Leute gelernt und bin immernoch am lernen
Mit einem Overload kannst Du eine bestehende Classe / Datei überladen und so z.B. weitere Daten hinzufügen, ohne die originale Datei ändern zu müssen. Damit werden Änderungen nicht mehr von einem Update überschreiben und müssen seltener angepasst werden.
@barbara : Vielen Dank für deine rasche Antwort. Für alle die sich nach dem Beitrag fragen wie man ein Overload schreibt, möchte ich auf diesen Beitrag hinweisen:https://developers.gambio.de/tutorials.html?v=3.0.0.0&p=class-overloading. Bevor ich mich an die Arbeit mache, habe ich aber noch eine Frage. Ist die Lösung die Cyrus beschreibt auch geeignet für Staffelpreise? Ich meine,wird hiermit im Shop dann der niedrigste Preis angezeigt oder ist es so, dass man den normalen Produktpreis zu sehen bekommt, mit einem "ab" davor?
Die Lösung bezieht sich auf Attribute-Preise, bzw. das "ab" davor, nicht auf Staffelpreise. Für Staffelpreise wirst Du Dich mit dem Overload an einer anderen Stelle einhaken müssen.