Statt Artikelanzahl eine grüne Ampel anzeigen

MyOOS hat einen Fehler, oder tut nicht das, was Ihr erwartet? Derartige "Unanehmlichkeiten" bitte hier.
Antworten
wolfschw
Beiträge: 396
Registriert: 01.03.2009, 21:23
Wohnort: Ilshofen
Kontaktdaten:

Statt Artikelanzahl eine grüne Ampel anzeigen

Beitrag von wolfschw »

Hallo

Kann man Statt der Artikelanzahl in der Produktliste
eine Ampel (z.B. Rot oder Grün) für vorrätige Produkte
anzeigen lassen ?

Beispiel:
Artikelanzahl = 1 oder mehr (Grüne Ampel)
Artikelanzahl = 0 (Rote Ampel)

Wenn ja in welcher Datei muß man wo was ändern ?

gruß

wolfgang
r23
Beiträge: 2625
Registriert: 18.09.2008, 05:56
Wohnort: Hagen
Kontaktdaten:

Beitrag von r23 »

Hallo,

~/shop/includes/modules/product_listing.php

Code: Alles auswählen

          case 'PRODUCT_LIST_QUANTITY':
            $lc_align = 'right';
            $lc_text = ' ' . $listing['products_quantity] . ' ';
            break;
hoffe die Antwort hilft weiter

ralf
wolfschw
Beiträge: 396
Registriert: 01.03.2009, 21:23
Wohnort: Ilshofen
Kontaktdaten:

Beitrag von wolfschw »

Hallo

Danke für die Info

Wie stelle ich es an das er mir zwei verschiedene Bilder anzeigt ?
Oder was kostet es wenn du es mir umschreibst ?

gruß

wolfgang
r23
Beiträge: 2625
Registriert: 18.09.2008, 05:56
Wohnort: Hagen
Kontaktdaten:

Beitrag von r23 »

Code: Alles auswählen

case 'PRODUCT_LIST_QUANTITY':
             if ($listing['products_quantity] > 0) {
              $pq_image = 'ampel_gruen.gif';
            } else {
              $pq_image = 'ampel_rot.gif';
            }
            $lc_align = 'center';
            $lc_text .= oos_image(OOS_IMAGES . $pq_image, $listing['products_quantity]);
break;
nicht geprüft

Die Grafiken "ampel_gruen.gif" und "ampel_rot.gif" in das Verzeichnis
~/shop/images/ legen...
wolfschw
Beiträge: 396
Registriert: 01.03.2009, 21:23
Wohnort: Ilshofen
Kontaktdaten:

Beitrag von wolfschw »

Hallo

Ok es funktioniert
Nur der Punkt vor dem = Zeichen muß entfernt werden
sonst steht noch der Artikelname vor dem Image

Code: Alles auswählen

 $lc_text .= oos_image(OOS_IMAGES . $pq_image, $listing['products_quantity]);


gruß

wolfgang
wolfschw
Beiträge: 396
Registriert: 01.03.2009, 21:23
Wohnort: Ilshofen
Kontaktdaten:

Lagerbestand bzw. Grüne Ampel in Produkt-Info anzeigen

Beitrag von wolfschw »

Hallo

Wie bekomme ich den Lagerbestand bzw. die 'ampel_gruen.gif' oder 'ampel_gelb.gif'
in der Produktinformation angezeigt.

Die Produktinformation wird ja in der produkt_info.html wieder gegeben.
Ist dieses überhaupt möglich ???

Gruß

Wolfgang
r23
Beiträge: 2625
Registriert: 18.09.2008, 05:56
Wohnort: Hagen
Kontaktdaten:

Beitrag von r23 »

Hallo,

wir fragen in dem Script
~/shop/includes/pages/products/info.php
folgende Datenfelder ab.

Code: Alles auswählen

  $product_info_sql = "SELECT p.products_id, pd.products_name, pd.products_description, pd.products_url,
                              pd.products_description_meta, pd.products_keywords_meta, p.products_model,
                              p.products_quantity, p.products_image, p.products_subimage1, p.products_subimage2,
                              p.products_subimage3, p.products_subimage4, p.products_subimage5, p.products_subimage6,
                              p.products_movie, p.products_zoomify, p.products_discount_allowed, p.products_price,
                              p.products_base_price, p.products_base_unit, p.products_quantity_order_min, p.products_quantity_order_units,
                              p.products_discount1, p.products_discount2, p.products_discount3, p.products_discount4,
                              p.products_discount1_qty, p.products_discount2_qty, p.products_discount3_qty,
                              p.products_discount4_qty, p.products_tax_class_id, p.products_units_id, p.products_date_added,
                              p.products_date_available, p.manufacturers_id, p.products_price_list
                        FROM $productstable p,
                             $products_descriptiontable pd
                        WHERE p.products_status >= '1'
                          AND p.products_id = '" . intval($nProductsId) . "'
                          AND pd.products_id = p.products_id
                          AND pd.products_languages_id = '" . intval($nLanguageID) . "'";
  $product_info_result = $dbconn->Execute($product_info_sql);
in dem Feld products_quantity steht der Lagerbestand.

in dem Template
~/oos_temp/templates/*.*/products/products_info.html

kann man den Lagerbestand mit

Code: Alles auswählen

{$product_info.products_quantity}
an der gewünschten Stelle anzeigen.

auf der Produkt - Info Seite ist eine Text-Ausgabe wie
Noch 3 Stück auf Lager.
sinnvoll.

Dafür kann man eine if else in Smarty verwenden
http://www.smarty.net/manual/de/languag ... ion.if.php

Code: Alles auswählen

{if $product_info.products_quantity lt 5}
<b>Noch {$product_info.products_quantity} Stück auf Lager.[/b] 
{/if}
D.h. der Text Noch 3 Stück auf Lager wird nur dann angezeigt, wenn
die Produkt Menge unter 5 sinkt. Man kann dies selbstverständlich in die
Abhängikeit von seinem Mindestlagerbestand bringen.

Die Produkte, die die "Mindestmengen auf dem Lager" unterschritten haben,
zeigen wir im Admin unter
http://demo.myoos.de/admin/stats_low_stock.php
an.

in der Datenbank steht dieser Wert in
products_reorder_level
den o.g. SELECT erweitern

[mysql] SELECT p.products_id, pd.products_name, pd.products_description, pd.products_url,
pd.products_description_meta, pd.products_keywords_meta, p.products_model,
p.products_quantity, p.products_reorder_level, p.products_image, usw.[/mysql]

im Template

Code: Alles auswählen

{if $product_info.products_quantity lt  $product_info.products_reorder_level}
<b>Noch {$product_info.products_quantity} Stück auf Lager.</b>
{/if}
Ich hoffe die Antwort hilft weiter

ralf
r23
Beiträge: 2625
Registriert: 18.09.2008, 05:56
Wohnort: Hagen
Kontaktdaten:

Beitrag von r23 »

ampel geht etwas anders.

bei der Ampel fragt man in der Regel den status ab in der DB ab. Das Feld ist products_status

wie oben beschreibe, den Select erweitern

[mysql]SELECT p.products_id, pd.products_name, pd.products_description, pd.products_url,
pd.products_description_meta, pd.products_keywords_meta, p.products_model,
p.products_quantity, p.products_image, p.products_subimage1, p.products_subimage2,
p.products_subimage3, p.products_subimage4, p.products_subimage5, p.products_subimage6,
p.products_movie, p.products_zoomify, p.products_discount_allowed, p.products_price,
p.products_base_price, p.products_base_unit, p.products_quantity_order_min, p.products_quantity_order_units,
p.products_discount1, p.products_discount2, p.products_discount3, p.products_discount4,
p.products_discount1_qty, p.products_discount2_qty, p.products_discount3_qty,
p.products_discount4_qty, p.products_tax_class_id, p.products_units_id, p.products_date_added,
p.products_date_available, p.manufacturers_id, p.products_price_list, products_status[/mysql]

Der Status eine Zahl

{$product_info.products_status}

die grafik speichert man als

ample_1.gif
ample_2.gif
ample_3.gif ab

und im Template

Code: Alles auswählen

<img src="{$theme_image}/ample_{$product_info.products_status}.gif" height="15" width="16" alt="" /> 
Hoffe auch dies hilft weiter

ralf
wolfschw
Beiträge: 396
Registriert: 01.03.2009, 21:23
Wohnort: Ilshofen
Kontaktdaten:

Beitrag von wolfschw »

Hallo

Ganz so kompliziert sollte es eigentlich nicht aussehen.
Sondern einfach ein GIF-Bild.
Ampel grün für Produkt ist sofort Verfügbar
oder Ampel gelb für Produkt hat Lieferzeit von 5 Tage

Beispiel: http://www.jura-ersatzteile-shop.de/Jur ... -c-47.html

Gruß

Wolfgang
r23
Beiträge: 2625
Registriert: 18.09.2008, 05:56
Wohnort: Hagen
Kontaktdaten:

Beitrag von r23 »

Hallo,

der Lagerbestand steht im Template selbstverständlich als Zahl zur Verfügung

Code: Alles auswählen

Lagerbestand: {$product_info.products_quantity}

Wenn man auf Basis von if / else etwas im Template anzeigen möchte,
hilft das Handbuch von Smarty bei der Syntax leicht weiter
http://www.smarty.net/manual/de/languag ... ion.if.php

Code: Alles auswählen

{if $product_info.products_quantity lt 5}
<img src="{$theme_image}/ampel_gelb.gif" height="15" width="16" alt="Lieferzeit 5 Tage" /> 
{else}
<img src="{$theme_image}/ampel_grue.gif" height="15" width="16" alt="sofort" />
{/if}
die Syntax
http://www.smarty.net/manual/de/languag ... ion.if.php

Schnönes Wochenende

Den Link zu mir löschen ist schlicht und einfach eine sauerrei

Copyright © 2010 Michaelas Shop-Ecke Powered by OOS [OSIS Online Shop]
OOS [OSIS Online Shop] is Free Software released under the GNU/GPL License.

dafür gibt es die
http://www.myoos.de/info/Projektbezogen ... -p-38.html

Bye
Zuletzt geändert von r23 am 20.03.2010, 18:19, insgesamt 1-mal geändert.
wolfschw
Beiträge: 396
Registriert: 01.03.2009, 21:23
Wohnort: Ilshofen
Kontaktdaten:

Beitrag von wolfschw »

Hallo

Der Link

Copyright © 2010 Michaelas Shop-Ecke Powered by OOS [OSIS Online Shop]
OOS [OSIS Online Shop] is Free Software released under the GNU/GPL License.

war mir bisher nicht bewust das er nicht funktioniert.

Der GNU/GPL License Link funktioniert ja auch noch.

Ich werde dieses natürlich ändern.


Sorry

Gruß

Wolfgang
Antworten