Neuigkeiten
  • Die modified eCommerce Shopsoftware ist kostenlos, aber nicht umsonst.
    Spenden
  • Damit wir die modified eCommerce Shopsoftware auch zukünftig kostenlos anbieten können:
    Spenden
  • Thema: Lagerbestand update in Produktliste

    Q

    • Fördermitglied
    • Beiträge: 1.537
    Lagerbestand update in Produktliste
    am: 27. März 2012, 14:50:42
    Hier kann man den Lagerbestand über die Artikelliste im Adminbereich aktualisieren:

    In der categories.php nach (ca. Zeile 88)

    Code: PHP  [Auswählen]
    //regular actions
    if ($_GET['action']) {
            switch ($_GET['action']) {

    folgendes einfügen:

    Code: PHP  [Auswählen]
    // stock update in product listing begins
        case 'new_stock':
            $pID = xtc_db_prepare_input($_GET['pID']);
              xtc_db_query("update products set products_quantity = " . $_GET["new_stock"]."  where products_id =  $pID ");
                          xtc_redirect(xtc_href_link(FILENAME_CATEGORIES, xtc_get_all_get_params(array('pID', 'action')) . 'pID=' . $pID ));
    // stock update in product listing ends        

    In der categories_view.php nach (ca. Zeile 745)

    Code: PHP  [Auswählen]
                $contents[] = array('text' => '<div style="padding-left: 30px;">' . $price_string.  '</div><div style="padding-left: 30px;">' . TEXT_PRODUCTS_DISCOUNT_ALLOWED_INFO . '&nbsp;' . $pInfo->products_discount_allowed . '</div><div style="padding-left: 30px;">' .  TEXT_PRODUCTS_QUANTITY_INFO . '&nbsp;' . $pInfo->products_quantity . '</div>');            
                // END IN-SOLUTION

    folgendes einfügen:

    Code: PHP  [Auswählen]
                // stock update in product listing begins
                $contents[] = array('text' => '<div style="padding-left: 30px; padding-bottom: 10px;"><form action="' . xtc_href_link(FILENAME_CATEGORIES, xtc_get_all_get_params(array('$cPath', 'action')) . 'oID=' . $pInfo->products_id . '&action=new_stock') . ' method="post" name="new_stock"><input type="hidden" name="pID" value="' . $pInfo->products_id . '"><input type="text" name="new_stock" size="7" value="'.$pInfo->products_quantity.'"><input type="hidden" name="action" value="new_stock"><input type="hidden" name="cPath" value="' . $cPath . '"><input type="submit" value="'.TEXT_PRODUCTS_NEW_STOCK.'">'. '</div>');
                // stock update in product listing ends
     

    und in der Sprachdatei categories.php noch folgendes einfügen:
    Code: PHP  [Auswählen]
    // stock update in product listing begins
    define('TEXT_PRODUCTS_NEW_STOCK', 'Lagerbestand ändern');
    // stock update in product listing ends

    Quelle: http://addons.oscommerce.com/info/4812

    Linkback: https://www.modified-shop.org/forum/index.php?topic=19168.0

    ASNCM

    • Frisch an Board
    • Beiträge: 81
    • Geschlecht:
    Re: Lagerbestand update in Produktliste
    Antwort #1 am: 29. März 2012, 12:09:18
    Hi.

    Danke für dieses Modul.
    Habe es verbaut in der 1.05b Version und klappt alles ohne Probleme.

    Gruss
    ASNCM

    jannemann

    • modified Team
    • Beiträge: 6.275
    • Geschlecht:
    Re: Lagerbestand update in Produktliste
    Antwort #2 am: 29. März 2012, 17:41:02
    Hallo oneQ,

    vielen Dank fürs Teilen!  :thumbs:

    Schöne Grüße,
    Jan

    WayneTsun

    • Fördermitglied
    • Beiträge: 1.082
    • Geschlecht:
    Re: Lagerbestand update in Produktliste
    Antwort #3 am: 29. März 2012, 18:28:22
    Hi oneQ!

    Klappt perfekt auf 1.05 SP1b! Vielen Dank!

    Wayne

    xxhappyxx

    • Viel Schreiber
    • Beiträge: 829
    • Geschlecht:
    Re: Lagerbestand update in Produktliste
    Antwort #4 am: 29. März 2012, 19:55:28
    Hallo Zusammen,

    auch von mir ein dickes Danke fürs teilen.

    Ich würde nur ne kleine Verbesserung vorschlagen. Damit im IE die Box nicht zu groß angezeigt wird würde ich den Code in der categories_view.php folgendermaßen abändern:

    Code: PHP  [Auswählen]
                // stock update in product listing begins
                $contents[] = array('text' => '<div style="padding-left: 30px;"><form action="' . xtc_href_link(FILENAME_CATEGORIES, xtc_get_all_get_params(array('$cPath', 'action')) . 'oID=' . $pInfo->products_id . '&action=new_stock') . ' method="post" name="new_stock"><input type="hidden" name="pID" value="' . $pInfo->products_id . '"><input type="text" name="new_stock" size="4" value="'.$pInfo->products_quantity.'"><input type="hidden" name="action" value="new_stock"><input type="hidden" name="cPath" value="' . $cPath . '"><input type="submit" style="width:150px" value="'.TEXT_PRODUCTS_NEW_STOCK.'">'. '</div>');
                // stock update in product listing ends

    Ansonsten ne nette kleine Erweiterung und läuft 1a.

    Gruß Thomas

    tigerdeutschland

    • Neu im Forum
    • Beiträge: 18
    Re: Lagerbestand update in Produktliste
    Antwort #5 am: 07. Mai 2012, 00:08:08
     :thx:  :thx:   und  :thx:!!!!!!

    Das spart ne Menge Klicks und schont die linke Maustaste :cheers1:
    4 Antworten
    1230 Aufrufe
    24. April 2020, 10:17:47 von Q
    15 Antworten
    9621 Aufrufe
    30. März 2020, 16:40:03 von mannoo
    8 Antworten
    4261 Aufrufe
    26. Dezember 2010, 17:00:31 von h-h-h
    1 Antworten
    1928 Aufrufe
    13. Dezember 2012, 17:03:39 von noRiddle (revilonetz)