Marktplatz - Eine große Auswahl an neuen und hilfreichen Modulen sowie modernen Templates für die modified eCommerce Shopsoftware
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: Schnellkauf Stückzahl eingeben

    pomm

    • Schreiberling
    • Beiträge: 258
    Schnellkauf Stückzahl eingeben
    am: 18. Oktober 2013, 15:22:25
    Hallo!

    In meinem Shop wird von Stammkunden gerne direkt mit der Artikelnummer bestellt. Dazu benutzen sie die Fkt. Schnellkauf. Die Artikel landen dann im Warenkorb mit Anzahl 1 und erst dort kann die Anzahl verändert werden. Gibt es eine Möglichkeit ein zweites Feld mit der Anzahl gleich in der Schnellkaufbox einzubauen?

    Shopsoftware: v 1.06 rev 4642
    Original Template xtc5
    Danke!

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

    noRiddle (revilonetz)

    • Experte
    • Beiträge: 13.990
    • Geschlecht:
    Re: Schnellkauf Stückzahl eingeben
    Antwort #1 am: 18. Oktober 2013, 16:58:26
    Ja, einfach einbauen ;-).
    (/templates/YOUR_TEMPLATE/source/boxes/add_a_quickie.php)
    Der Wert des Feldes muß dann natürlich an den Warenkorb übergeben werden (/includes/cart_actions.php, case 'add_a_quickie' :)

    Gruß,
    noRiddle

    pomm

    • Schreiberling
    • Beiträge: 258
    Re: Schnellkauf Stückzahl eingeben
    Antwort #2 am: 18. Oktober 2013, 21:04:03
    Danke für die rasche Antwort!
    Kannst du mir das etwas genauer beschreiben was wo rein muß? Danke!
    Hier die beiden Files:
    add_a_quickie.php:
    <?php

    /* -----------------------------------------------------------------------------------------
       $Id: add_a_quickie.php 1262 2005-09-30 10:00:32Z mz $

       XT-Commerce - community made shopping
       http://www.(( Wir dulden keine kommerziellen Werbelinks - Bitte Forenregeln beachten! ))

       Copyright (c) 2003 XT-Commerce
       -----------------------------------------------------------------------------------------
       based on:
       (c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
       (c) 2002-2003 osCommerce(add_a_quickie.php,v 1.10 2001/12/19); www.oscommerce.com

       Released under the GNU General Public License
       -----------------------------------------------------------------------------------------
       Third Party contribution:
       Add A Quickie v1.0 Autor  Harald Ponce de Leon

       Released under the GNU General Public License
       ---------------------------------------------------------------------------------------*/

    // reset var
    $box_smarty = new smarty;
    $box_content = '';
    $box_smarty->assign('tpl_path', 'templates/' . CURRENT_TEMPLATE . '/');
    // BOF - GTB - 2010-09-20 - correct the Formular in dependences of the request type SSL / NONSSL
    $box_smarty->assign('FORM_ACTION','<form id="quick_add" method="post" action="' . xtc_href_link(basename($PHP_SELF), xtc_get_all_get_params(array ('action')) . 'action=add_a_quickie', $request_type) . '">');
    //$box_smarty->assign('FORM_ACTION','<form id="quick_add" method="post" action="' . xtc_href_link(basename($PHP_SELF), xtc_get_all_get_params(array ('action')) . 'action=add_a_quickie', 'NONSSL') . '">');
    // EOF - GTB - 2010-09-20 - correct the Formular in dependences of the request type SSL / NONSSL
    $box_smarty->assign('INPUT_FIELD',xtc_draw_input_field('quickie','','style="width:170px"'));
    $box_smarty->assign('SUBMIT_BUTTON', xtc_image_submit('button_add_quick.gif', BOX_HEADING_ADD_PRODUCT_ID));
    $box_smarty->assign('FORM_END', '</form>');

    $box_smarty->assign('BOX_CONTENT', $box_content);
    $box_smarty->assign('language', $_SESSION['language']);

    $box_smarty->caching = 0;
    $box_add_a_quickie = $box_smarty->fetch(CURRENT_TEMPLATE . '/boxes/box_add_a_quickie.html');

    $smarty->assign('box_ADD_QUICKIE', $box_add_a_quickie);
    ?>

    cart_actions.php:
    <?php
    /* -----------------------------------------------------------------------------------------
       $Id: cart_actions.php 3255 2012-07-18 18:27:41Z web28 $

       modified eCommerce Shopsoftware
       http://www.modified-shop.org

       Copyright (c) 2009 - 2013 [www.modified-shop.org]
       -----------------------------------------------------------------------------------------
       based on:
       (c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
       (c) 2002-2003 osCommerce(application_top.php,v 1.273 2003/05/19); www.oscommerce.com
       (c) 2003 nextcommerce (application_top.php,v 1.54 2003/08/25); www.nextcommerce.org
       (c) 2006 XT-Commerce (cart_actions.php 168 2007-02-06)

       Released under the GNU General Public License
       -----------------------------------------------------------------------------------------
       Third Party contribution:
       Add A Quickie v1.0 Autor  Harald Ponce de Leon

       Credit Class/Gift Vouchers/Discount Coupons (Version 5.10)
       http://www.oscommerce.com/community/contributions,282
       Copyright (c) Strider | Strider@oscworks.com
       Copyright (c) Nick Stanko of UkiDev.com, nick@ukidev.com
       Copyright (c) Andre ambidex@gmx.net
       Copyright (c) 2001,2002 Ian C Wilson http://www.phesis.org

       Released under the GNU General Public License
       ---------------------------------------------------------------------------------------*/

    $action = (isset($_GET['action']) ? $_GET['action'] : '');

    // Shopping cart actions
    if (xtc_not_null($action)) {
      // redirect the customer to a friendly cookie-must-be-enabled page if cookies are disabled
      if ($session_started == false) {
        xtc_redirect(xtc_href_link(FILENAME_COOKIE_USAGE));
      }

      $parameters = array ('action', 'products_id', 'pid');
      if (DISPLAY_CART == 'true') {
        $goto = FILENAME_SHOPPING_CART;
        $parameters[] = 'cPath';
      } else {
        $goto = basename($PHP_SELF);
        if ($_GET['action'] == 'buy_now') {
          $parameters[] = 'BUYproducts_id';
        } else {
          array_push($parameters, 'BUYproducts_id', 'info');
        }
      }

      if (!is_object($_SESSION['cart'])) {
        $_SESSION['cart'] = new shoppingCart();
      }

      switch ($action) {

        case 'remove_product':
          $prd_id = xtc_input_validation($_GET['prd_id'], 'products_id', '');
          $_SESSION['cart'] -> remove($prd_id);
          xtc_redirect(xtc_href_link($goto, xtc_get_all_get_params($parameters), 'NONSSL'));
          break;

        // customer wants to update the product quantity in their shopping cart
        case 'update_product':
          if (isset($econda) && is_object($econda)) {
            $econda->_emptyCart();
          }
          for ($i = 0, $n = sizeof($_POST['products_id']); $i < $n; $i++) {

              $cart_quantity = $_POST['cart_quantity'][$i] = xtc_remove_non_numeric($_POST['cart_quantity'][$i]);
              $_POST['old_qty'][$i] = xtc_remove_non_numeric($_POST['old_qty'][$i]);
              $_POST['products_id'][$i] = xtc_input_validation($_POST['products_id'][$i], 'products_id', '');

              if ($cart_quantity == 0) $_SESSION['cart']->remove($_POST['products_id'][$i]);

              if (in_array($_POST['products_id'][$i], (isset($_POST['cart_delete']) && is_array($_POST['cart_delete']) ? $_POST['cart_delete'] : array ()))) {
              $_SESSION['cart']->remove($_POST['products_id'][$i]);

              if (isset($econda) && is_object($econda))
              $econda->_delArticle($_POST['products_id'][$i], $_POST['cart_quantity'][$i], $_POST['old_qty'][$i]);

            } else {
              if ($cart_quantity > MAX_PRODUCTS_QTY)
                $cart_quantity = MAX_PRODUCTS_QTY;
              $attributes = isset($_POST['id'][$_POST['products_id'][$i]]) ? $_POST['id'][$_POST['products_id'][$i]] : '';

              if (isset($econda) && is_object($econda)) {
                $old_quantity = $_SESSION['cart']->get_quantity(xtc_get_uprid($_POST['products_id'][$i], $_POST['id'][$i]));
                $econda->_updateProduct($_POST['products_id'][$i], $cart_quantity, $old_quantity);
              }
              $_SESSION['cart']->add_cart($_POST['products_id'][$i], $cart_quantity, $attributes, false);
              unset($cart_quantity);
            }
          }
          xtc_redirect(xtc_href_link($goto, xtc_get_all_get_params($parameters), 'NONSSL'));
          break;

        // customer adds a product from the products page
        case 'add_product':
          if (isset ($_POST['products_id']) && is_numeric($_POST['products_id'])) {
                $cart_quantity = (xtc_remove_non_numeric($_POST['products_qty']) + $_SESSION['cart']->get_quantity(xtc_get_uprid($_POST['products_id'], isset($_POST['id'])?$_POST['id']:'')));
            if ($cart_quantity > MAX_PRODUCTS_QTY) {
              $cart_quantity = MAX_PRODUCTS_QTY;
            }
            if (isset($econda) && is_object($econda)) {
              $econda->_emptyCart();
              $old_quantity = $_SESSION['cart']->get_quantity(xtc_get_uprid($_POST['products_id'], isset($_POST['id'])?$_POST['id']:''));
              $econda->_addProduct($_POST['products_id'], $cart_quantity, $old_quantity);
            }
            $_SESSION['cart']->add_cart((int)$_POST['products_id'], $cart_quantity, isset($_POST['id'])?$_POST['id']:''); //DokuMan - 2012-06-11 - added isset-check for $_POST['id']
          }
          xtc_redirect(xtc_href_link($goto, 'products_id=' . (int)$_POST['products_id'] . '&' . xtc_get_all_get_params($parameters)));
          break;

        case 'check_gift':
          require_once (DIR_FS_INC . 'xtc_collect_posts.inc.php');
          xtc_collect_posts();
          break;

        // customer wants to add a quickie to the cart (called from a box)
        case 'add_a_quickie' :
          $quicky = addslashes($_POST['quickie']);
          if (GROUP_CHECK == 'true') {
            $group_check = "and group_permission_" . $_SESSION['customers_status']['customers_status_id'] . "=1 ";
          }
          $quickie_query = xtc_db_query("select products_fsk18,
                                                products_id
                                          from " . TABLE_PRODUCTS . "
                                         where products_model = '" . $quicky . "' " . "
                                           AND products_status = '1' " . $group_check
                                        );

          if (!xtc_db_num_rows($quickie_query)) {
            if (GROUP_CHECK == 'true') {
              $group_check = "and group_permission_" . $_SESSION['customers_status']['customers_status_id'] . "=1 ";
            }
            $quickie_query = xtc_db_query("select products_fsk18,
                                                  products_id
                                             from " . TABLE_PRODUCTS . "
                                            where products_model LIKE '%" . $quicky . "%' " . "
                                              AND products_status = '1' " . $group_check
                                          );
          }
          if (xtc_db_num_rows($quickie_query) != 1) {
            xtc_redirect(xtc_href_link(FILENAME_ADVANCED_SEARCH_RESULT, 'keywords=' . $quicky, 'NONSSL'));
          }
          $quickie = xtc_db_fetch_array($quickie_query);
          if (xtc_has_product_attributes($quickie['products_id'])) {
            xtc_redirect(xtc_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $quickie['products_id'], 'NONSSL'));
          } else {
            if ($quickie['products_fsk18'] == '1' && $_SESSION['customers_status']['customers_fsk18'] == '1') {
              xtc_redirect(xtc_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $quickie['products_id'], 'NONSSL'));
            }
            if ($_SESSION['customers_status']['customers_fsk18_display'] == '0' && $quickie['products_fsk18'] == '1') {
              xtc_redirect(xtc_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $quickie['products_id'], 'NONSSL'));
            }
            if ($_POST['quickie'] != '') {
              $act_qty = $_SESSION['cart']->get_quantity(xtc_get_uprid($quickie['products_id'], 1));
              if ($act_qty > MAX_PRODUCTS_QTY) {
                $act_qty = MAX_PRODUCTS_QTY - 1;
              }
              $_SESSION['cart']->add_cart($quickie['products_id'], $act_qty +1, 1);
              xtc_redirect(xtc_href_link($goto, xtc_get_all_get_params(array('action')), 'NONSSL'));
            } else {
              xtc_redirect(xtc_href_link(FILENAME_ADVANCED_SEARCH_RESULT, 'keywords=' . $quicky, 'NONSSL'));
            }
          }
          break;

        // performed by the 'buy now' button in product listings and review page
        case 'buy_now':
          if (isset($_GET['BUYproducts_id'])) {
            $_GET['BUYproducts_id'] = (int)$_GET['BUYproducts_id'];
            // check permission to view product
            $permission_query = xtc_db_query("SELECT group_permission_" . $_SESSION['customers_status']['customers_status_id'] . " as customer_group,
                                                     products_fsk18
                                               from " . TABLE_PRODUCTS . "
                                              where products_id='" . $_GET['BUYproducts_id'] . "'");
            $permission = xtc_db_fetch_array($permission_query);

            // check for FSK18
            if ($permission['products_fsk18'] == '1' && $_SESSION['customers_status']['customers_fsk18'] == '1') {
              xtc_redirect(xtc_href_link(FILENAME_PRODUCT_INFO, 'products_id=' .$_GET['BUYproducts_id'], 'NONSSL'));
            }
            if ($_SESSION['customers_status']['customers_fsk18_display'] == '0' && $permission['products_fsk18'] == '1') {
              xtc_redirect(xtc_href_link(FILENAME_PRODUCT_INFO, 'products_id=' .$_GET['BUYproducts_id'], 'NONSSL'));
            }
            // check for customer group
            if (GROUP_CHECK == 'true') {
              if ($permission['customer_group'] != '1') {
                xtc_redirect(xtc_href_link(FILENAME_PRODUCT_INFO, 'products_id=' .$_GET['BUYproducts_id']));
              }
            }
            if (xtc_has_product_attributes($_GET['BUYproducts_id'])) {
              xtc_redirect(xtc_href_link(FILENAME_PRODUCT_INFO, 'products_id=' .$_GET['BUYproducts_id']));
            } else {
              if (isset ($_SESSION['cart'])) {
                $cart_quantity = ($_SESSION['cart']->get_quantity(xtc_get_uprid($_GET['BUYproducts_id'],''))+1);
                if ($cart_quantity > MAX_PRODUCTS_QTY) {
                  $cart_quantity = MAX_PRODUCTS_QTY;
                }
                if (isset($econda) && is_object($econda)) {
                  $econda->_emptyCart();
                  $old_quantity = $_SESSION['cart']->get_quantity($_GET['BUYproducts_id']);
                  $econda->_addProduct($_GET['BUYproducts_id'], $cart_quantity, $old_quantity);
                }
                $_SESSION['cart']->add_cart($_GET['BUYproducts_id'], $cart_quantity);
              } else {
                xtc_redirect(xtc_href_link(FILENAME_DEFAULT));
              }
            }
          }
          xtc_redirect(xtc_href_link($goto, xtc_get_all_get_params(array ('action','BUYproducts_id'))));
          break;

        case 'cust_order':
          if (isset ($_SESSION['customer_id']) && isset ($_GET['pid'])) {
            $_GET['pid'] = (int)$_GET['pid'];
            if (xtc_has_product_attributes($_GET['pid'])) {
              xtc_redirect(xtc_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $_GET['pid']));
            } else {
              $_SESSION['cart']->add_cart($_GET['pid'], $_SESSION['cart']->get_quantity($_GET['pid']) + 1);
            }
          }
          xtc_redirect(xtc_href_link($goto, xtc_get_all_get_params($parameters), 'NONSSL'));
          break;

        // BOF - Tomcraft - 2011-02-01 - Paypal Express Modul
        case 'paypal_express_checkout':
          $o_paypal->paypal_express_auth_call();
          xtc_redirect($o_paypal->payPalURL);
          break;
        // EOF - Tomcraft - 2011-02-01 - Paypal Express Modul
      }
    }
    ?>
    Danke!
    LG
    Pomm

    noRiddle (revilonetz)

    • Experte
    • Beiträge: 13.990
    • Geschlecht:
    Re: Schnellkauf Stückzahl eingeben
    Antwort #3 am: 19. Oktober 2013, 01:39:30
      • Was meinst du wofür die Icons über dem Post-Fenster sind ?
        Bitte Code in code-tags posten (in deinem Fall php).
        Ohne wird der Post ellenlang und niemand hat Lust den zu lesen.
      • Außerdem brauchst du nicht deine Dateien zu posten,
        Du hats ja deine Shopversion angegeben (Lob !).
        Die Dateien können wir dann selbst nachsehen.
      • Ich kann dir jetzt hier keine Copy & Paste -Anleitung schreiben.
        Wenn du überhaupt keine Ahnung von PHP und Smarty hast mußt du halt Support anfragen
        oder einen anderes fähigen Forums-Mitglied beauftragen, wovon es hier einige gibt.
        Sowas kann man nur mit einem Tutorial beantworten wenn man es
        • a) schonmal gemacht hat oder
        • b) gerade Zeit und Lust dazu hat.
        Beides ist bei mir mom. nicht der Fall.

      Ansonsten:
      Schaue dir einfach das Feld für die Artikelnummer an und wie es an den Warenkorb übergeben wird.
      Analog kannst du das für die Stückzahl machen.
      Z.B.:
    Code: PHP  [Auswählen]
    $box_smarty->assign('INPUT_QTY_FIELD',xtc_draw_input_field('quick_qty','1','style="width:20px"'));

    und in der cart_actions.php
    Code: PHP  [Auswählen]
    $quicky_qty = (int)$_POST['quick_qty'];
    usw.

    Gruß,
    noRiddle

    pomm

    • Schreiberling
    • Beiträge: 258
    Re: Schnellkauf Stückzahl eingeben
    Antwort #4 am: 19. Oktober 2013, 11:51:33
    Hab nun mal folgendes geändert:
    File add_a_quickie.php: quickie gekürzt von 170px auf 120px - funktioniert.
    Input_QTY_FIELD eingefügt (Zeile 2) und positioniert - wird nicht angezeigt?
    Code: PHP  [Auswählen]
    $box_smarty->assign('INPUT_FIELD',xtc_draw_input_field('quickie','','style="width:120px"'));
    $box_smarty->assign('INPUT_QTY_FIELD',xtc_draw_input_field('quickie_qty','','style="width:20px; position:relative; left:130px"'));

    File cart_action.php: Zeile 3 eingefügt
    Code: PHP  [Auswählen]
     case 'add_a_quickie' :
          $quicky = addslashes($_POST['quickie']);
          $quicky_qty = (int)$_POST['quick_qty'];

    keine Auswirkung weil ich Feld nicht sehe, muß das Feld noch wo rein zum anzeigen?
    Danke!
    LG
    Pomm

    noRiddle (revilonetz)

    • Experte
    • Beiträge: 13.990
    • Geschlecht:
    Re: Schnellkauf Stückzahl eingeben
    Antwort #5 am: 19. Oktober 2013, 16:27:17
    Ich habe das Gefühl, daß hier egozentrischerweise viele nichts mehr lesen was sie als Hilfe-Anleitungen bekommen.
    Meine Aussagen ignorieren bringt dich sicher nicht weiter.
    Ich sagte ich habe keine Zeit für ein ausführliches Tutorial, es sei denn ich hätte das selbst schonmal implementiert.

    Das neu definierte Smarty mußt du natürlich auch in /templates/DEIN_TEMPLATE/boxes/box_add_a_quickie.html einfügen.
    Die zugehörige *.php-Datei ist ja nur die die das Smarty definiert, die Ausgabe ist in o.g. Datei.

    Was /includes/cart_actions.php betrifft schrieb ich "usw.".
    Der Post-Wert muß ja noch verarbeitet werden.
    Schau dir den Code mal an bei case 'add_a_quickie' :.

    Für mehr Infos habe ich mom. keine Zeit.

    Wenn du's nicht hinbekommst mußt du halt, ich wiederhole mich, bezahlte Hilfe in Anspruch nehmen.

    Gruß,
    noRiddle

    pomm

    • Schreiberling
    • Beiträge: 258
    Re: Schnellkauf Stückzahl eingeben
    Antwort #6 am: 19. Oktober 2013, 19:22:55
    noriddle: Danke hat nichts mit egozentrisch zu tun würde es als effizient bezeichnen.

    Ev. gibt es auch noch andere im Forum vielleicht hat dies auch schon wer umgesetzt.
    Falls nicht poste ich mal meinen Stand vielleicht brauchts jemand:
    File add_a_quickie.php:
    Code: PHP  [Auswählen]
    $box_smarty->assign('INPUT_FIELD',xtc_draw_input_field('quickie','','style="width:120px"'));
    ersetzen durch:
    Code: PHP  [Auswählen]
    $box_smarty->assign('INPUT_FIELD',xtc_draw_input_field('quickie','','style="width:120px"'));
    $box_smarty->assign('INPUT_QTY_FIELD',xtc_draw_input_field('quickie_qty','','style="width:20px; position:relative; left:10px"'));

    pomm

    • Schreiberling
    • Beiträge: 258
    Re: Schnellkauf Stückzahl eingeben
    Antwort #7 am: 19. Oktober 2013, 20:03:25
    noriddle: Danke hat nichts mit egozentrisch zu tun würde es als effizient bezeichnen.

    Ev. gibt es auch noch andere im Forum vielleicht hat dies auch schon wer umgesetzt.
    Falls nicht poste ich mal meinen Stand vielleicht brauchts jemand:
    File add_a_quickie.php:
    Code: PHP  [Auswählen]
    $box_smarty->assign('INPUT_FIELD',xtc_draw_input_field('quickie','','style="width:120px"'));
    ersetzen durch:
    Code: PHP  [Auswählen]
    $box_smarty->assign('INPUT_FIELD',xtc_draw_input_field('quickie','','style="width:120px"'));
    $box_smarty->assign('INPUT_QTY_FIELD',xtc_draw_input_field('quickie_qty','','style="width:20px; position:relative; left:10px"'));

    cart_action.php
    Code: PHP  [Auswählen]
        case 'add_a_quickie' :
          $quicky = addslashes($_POST['quickie']);
    ersetzen durch:
    Code: PHP  [Auswählen]
        case 'add_a_quickie' :
          $quicky = addslashes($_POST['quickie']);
          $quicky_qty = (int)$_POST['quick_qty'];

    box_add_a_quickie.html
    Code: XML  [Auswählen]
    <p>{$INPUT_FIELD}</p>
    ersetzen durch:
    Code: XML  [Auswählen]
    <p>{$INPUT_FIELD} {$INPUT_QTY_FIELD}</p>

    Ergebnis:
    [ Für Gäste sind keine Dateianhänge sichtbar ]

    Sieht ja schon gut aus.
    Nun muß nur der Wert noch in die Bestellung, wenn ich es schaffe ergänze ich es zu einer ganzen Anleitung.
     Falls wer eine Idee hat bin ich natürlich auch dankbar.
    LG
    pomm

    hendrik

    • Experte
    • Beiträge: 2.038
    Re: Schnellkauf Stückzahl eingeben
    Antwort #8 am: 19. Oktober 2013, 23:15:48
    cart_actions.php, Zeile 164 ca.
    Code: PHP  [Auswählen]
    if ($act_qty > MAX_PRODUCTS_QTY) {
      $act_qty = MAX_PRODUCTS_QTY - 1;
    }
    $_SESSION['cart']->add_cart($quickie['products_id'], $act_qty +1, 1);

    Ändern in:
    Code: PHP  [Auswählen]
    if ( ($act_qty+$quicky_qty) > MAX_PRODUCTS_QTY) {
      $act_qty = MAX_PRODUCTS_QTY - $quicky_qty;
    }
    $_SESSION['cart']->add_cart($quickie['products_id'], $act_qty + $quicky_qty, 1);

    Nicht getestet.

    gruß
    hen

    pomm

    • Schreiberling
    • Beiträge: 258
    Re: Schnellkauf Stückzahl eingeben
    Antwort #9 am: 20. Oktober 2013, 11:05:16
    Hallo Hen!

    Danke für den Tip!
    Habs gleich getestet aber er erkennt mir die Eingabe nicht. Sobald ich die Zahl rausnehme (hab jetzt Symbolisch die 4 rein Zeile 44) bleibt der Warenkorb leer.
    Cart_actions.php
    Code: PHP  [Auswählen]
    // customer wants to add a quickie to the cart (called from a box)
        case 'add_a_quickie' :
          $quicky = addslashes($_POST['quickie']);
              $quicky_qty = (int)$_POST['quick_qty'];
          if (GROUP_CHECK == 'true') {
            $group_check = "and group_permission_" . $_SESSION['customers_status']['customers_status_id'] . "=1 ";
          }
          $quickie_query = xtc_db_query("select products_fsk18,
                                                products_id
                                          from "
    . TABLE_PRODUCTS . "
                                         where products_model = '"
    . $quicky . "' " . "
                                           AND products_status = '1' "
    . $group_check
                                        );

          if (!xtc_db_num_rows($quickie_query)) {
            if (GROUP_CHECK == 'true') {
              $group_check = "and group_permission_" . $_SESSION['customers_status']['customers_status_id'] . "=1 ";
            }
            $quickie_query = xtc_db_query("select products_fsk18,
                                                  products_id
                                             from "
    . TABLE_PRODUCTS . "
                                            where products_model LIKE '%"
    . $quicky . "%' " . "
                                              AND products_status = '1' "
    . $group_check
                                          );
          }
          if (xtc_db_num_rows($quickie_query) != 1) {
            xtc_redirect(xtc_href_link(FILENAME_ADVANCED_SEARCH_RESULT, 'keywords=' . $quicky, 'NONSSL'));
          }
          $quickie = xtc_db_fetch_array($quickie_query);
          if (xtc_has_product_attributes($quickie['products_id'])) {
            xtc_redirect(xtc_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $quickie['products_id'], 'NONSSL'));
          } else {
            if ($quickie['products_fsk18'] == '1' && $_SESSION['customers_status']['customers_fsk18'] == '1') {
              xtc_redirect(xtc_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $quickie['products_id'], 'NONSSL'));
            }
            if ($_SESSION['customers_status']['customers_fsk18_display'] == '0' && $quickie['products_fsk18'] == '1') {
              xtc_redirect(xtc_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $quickie['products_id'], 'NONSSL'));
            }
            if ($_POST['quickie'] != '') {
              $act_qty = $_SESSION['cart']->get_quantity(xtc_get_uprid($quickie['products_id'], 1));
              if (($act_qty+$quicky_qty) > MAX_PRODUCTS_QTY) {
                $act_qty = MAX_PRODUCTS_QTY - $quicky_qty;
              }
              $_SESSION['cart']->add_cart($quickie['products_id'], $act_qty + 4 + $quicky_qty, 1);
              xtc_redirect(xtc_href_link($goto, xtc_get_all_get_params(array('action')), 'NONSSL'));
            } else {
              xtc_redirect(xtc_href_link(FILENAME_ADVANCED_SEARCH_RESULT, 'keywords=' . $quicky, 'NONSSL'));
            }
          }
          break;

    Muß die Variable ev. noch wo anders def. werden?
    Code: PHP  [Auswählen]
    $quicky_qty = (int)$_POST['quick_qty'];

    Danke!
    LG
    pomm

    hendrik

    • Experte
    • Beiträge: 2.038
    Re: Schnellkauf Stückzahl eingeben
    Antwort #10 am: 20. Oktober 2013, 16:54:31
    Leute ihr müsst debuggen lernen wenn ihr programmieren wollt. Selten funktionieren Codes die man gerade geschrieben hat auf Anhieb. Auch nicht bei den Profis. Es ist echt keine Lösung hier seine unausgegorenen Codes abzuliefern und zu erwarten, daß einer die Sch.arbeit für einen erledigt.

    Mach dir Debugausgaben (Echo u.so) und prüfe ob die Variablen die erwarteten Werte haben. Dann tastest du dich systematisch an die Problemstelle heran.

    gruß
    hen

    pomm

    • Schreiberling
    • Beiträge: 258
    Re: Schnellkauf Stückzahl eingeben
    Antwort #11 am: 22. Oktober 2013, 19:48:44
    Danke für den Tip werde versuchen es zu lernen.
    Wenn ich das könnte würde ich es sicher nicht hier reinschreiben wäre doch etwas unproduktiv, bzw. würde ich die Lösung für alle anbieten als sinnvolle Ergänzung im B2B Bereich.
    LG
    Pomm
    10 Antworten
    3748 Aufrufe
    03. März 2016, 14:15:57 von Bonsai
    8 Antworten
    5769 Aufrufe
    15. Dezember 2008, 16:35:22 von Anonym
    1 Antworten
    1662 Aufrufe
    18. Mai 2018, 10:27:56 von StefanGold
    5 Antworten
    917 Aufrufe
    16. Oktober 2022, 16:42:43 von Eihops