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: BETA MODUL: Merkzettel oder Merkliste

    Kalle

    • Fördermitglied
    • Beiträge: 10
    • Geschlecht:
    BETA MODUL: Merkzettel oder Merkliste
    am: 15. September 2010, 09:25:56
    Hallo zusammen,

    ich plane, unseren Shop von osCommerce auf modified eCommerce Shopsoftware zu migrieren.

    Frage: ist eine Merkliste o.ö. in Planung, damit die Kunden nicht immer ihre nicht abgeschlossenen Warenkörbe dafür nutzen?

    Viele Grüße

    Kalle

    EDIT jannemann - 29.05.2015: Modul aktualisiert, _MERKZETTEL BETA_1.06-22.05.2015.zip] Vielen Dank an Gulliver72
    [EDIT jannemann - 27.06.2013: Modul für 1.06 angepasst. Vielen Dank an Koala!]
    [EDIT Tomcraft 19.03.2011: Hier geht es direkt zu Anleitung von ralph_84.]

    Linkback: https://www.modified-shop.org/forum/index.php?topic=8036.0
    Marktplatz - Eine große Auswahl an neuen und hilfreichen Modulen sowie modernen Templates für die modified eCommerce Shopsoftware

    albersmann

    • Fördermitglied
    • Beiträge: 786
    • Geschlecht:
    Re: BETA MODUL: Merkzettel oder Merkliste
    Antwort #1 am: 15. September 2010, 10:58:52
    Hi Kalle,

    schau doch mal hier: Merkzettel & Merkzettel Control für xt:C

    Muss vielleicht noch ein wenig angepasst werden.

    Grüße

    Sven

    ShadowSAW

    • Frisch an Board
    • Beiträge: 95
    Re: BETA MODUL: Merkzettel oder Merkliste
    Antwort #2 am: 15. September 2010, 11:30:20
    Ich finde eine Merkliste, sollte fester Bestandteil in XTC Modified werden.

    Gibt es bei Amazon.de schließlich auch.

    Gruß Dirk

    ShadowSAW

    • Frisch an Board
    • Beiträge: 95
    Re: BETA MODUL: Merkzettel oder Merkliste
    Antwort #3 am: 15. September 2010, 11:30:12
    Ich finde eine Merkliste, sollte fester Bestandteil in modified eCommerce Shopsoftware werden.

    Gibt es bei Amazon.de schließlich auch.

    Gruß Dirk

    ShadowSAW

    • Frisch an Board
    • Beiträge: 95
    Re: BETA MODUL: Merkzettel oder Merkliste
    Antwort #4 am: 15. September 2010, 11:30:30
    Ich finde eine Merkliste, sollte fester Bestandteil in XTC Modified werden.

    Gibt es bei Amazon.de schließlich auch.

    Gruß Dirk

    albersmann

    • Fördermitglied
    • Beiträge: 786
    • Geschlecht:
    Re: BETA MODUL: Merkzettel oder Merkliste
    Antwort #5 am: 15. September 2010, 12:23:51
    Hi Dirk,

    ist auch schon öfters diskutiert worden. Soweit ich weiss, ist es in die Liste aufgenommen worden.

    Gruß

    Sven

    ralph_84

    • Fördermitglied
    • Beiträge: 499
    • Geschlecht:
    Re: BETA MODUL: Merkzettel oder Merkliste
    Antwort #6 am: 03. November 2010, 18:31:35
    Hi Kalle,

    schau doch mal hier: Merkzettel & Merkzettel Control für xt:C

    Muss vielleicht noch ein wenig angepasst werden.

    Grüße

    Sven

    Hallo Freunde und Freundinnen

    Ich habe gerade den Merkzettel für modified eCommerce Shopsoftware angepasst.

    Das Control Modul werde ich mir die nächsten Tage vornehmen.

    Bei mir läuft das Modul genau gleich wie bei xt:Commerce.

    Nach der Installation Anleitung liegt bei sollte es auch bei Euch im modified eCommerce Shopsoftware laufen.

    Wünsche Euch viel Spaß damit.

    Gruß Ralph

    [EDIT Tomcraft 04.11.2010: Modul aktualisiert, Danke an ralph_84.]

    Tomcraft

    • modified Team
    • Gravatar
    • Beiträge: 46.369
    • Geschlecht:
    Re: BETA MODUL: Merkzettel oder Merkliste
    Antwort #7 am: 03. November 2010, 19:41:35
    Sind alle Fehler aus dem Modul entfernt worden? Soweit ich weiss ist das Modul eine ganz schlimme Quelle an Fehlern. :D

    Bitte mal ausgiebig testen und Rückmeldung geben, Danke! :thx:

    Und Danke für's Anpassen des Moduls! :thx:

    Grüße

    Torsten

    ralph_84

    • Fördermitglied
    • Beiträge: 499
    • Geschlecht:
    Re: BETA MODUL: Merkzettel oder Merkliste
    Antwort #8 am: 04. November 2010, 13:11:26
    Hallo Freunde

    Habe noch einen Fehler gefunden mit der Ablage des Merzettels.

    Wurde nach neu aufrufen des Shops auch im Warenkorb gefunden.

    Habe den Fehler beseitigt und die Anleitung geändert.

    Gruß Ralph

    [EDIT Tomcraft 04.11.2010: Anleitung im Modul aktualisiert.]

    Margott

    • Frisch an Board
    • Beiträge: 91
    Re: BETA MODUL: Merkzettel oder Merkliste
    Antwort #9 am: 04. November 2010, 17:05:35
    Hallo,

    mal ne blöde Frage. Habe alles installiert und geändert in den Dateien laut Anleittung und DB-Eintrag gemacht. Muß ich noch irgendwelche Einstellungen machen und vorallem wo? Habe mit einen Testkunden mich eingeloggt und einen Artikel in den Warenkorb gelegt, mich dann wieder ausgeloggt und gleich wieder eingeloggt. Aber ich sehe keinen Merkzettel?

    Oder hat jemand mal einen Sreenshot, damit ich weiß wie das aussehen soll? [ Für Gäste sind keine Dateianhänge sichtbar ]

    OK. HAT SICH ERLEDIGT!!!!!

    Boris

    • Fördermitglied
    • Beiträge: 102
    Re: BETA MODUL: Merkzettel oder Merkliste
    Antwort #10 am: 04. November 2010, 19:31:40
    Hallo, bekomme diesen Teil leider nicht in die \includes\cart_actions.php  :nixweiss:
    Könnt ihr mir da evtl. helfen?

    Aus der Anleitung:
    Zitat
    [...]
    hiermit ersetzen:

    Code: PHP  [Auswählen]
                                        // customer wants to update the product quantity in their shopping cart
                    case 'update_product' :

                    if (is_object($econda))
                            $econda->_emptyCart();
                    //BOF - Hetfield - 2009.08.18 - Bugfix for numeric quantitys
                            for ($i = 0, $n = sizeof($_POST['products_id']); $i <$n; $i++) {

                                            $cart_quantity = xtc_remove_non_numeric($_POST['cart_quantity'][$i]);

                                            if($_POST['submit_target'] == 'wishlist') //WISHLIST ############
                                    {
                                            if (in_array($_POST['products_id'][$i], (is_array($_POST['cart_delete']) ? $_POST['cart_delete'] : array()))) {
                                                    $_SESSION['wishList']->remove($_POST['products_id'][$i]);

                                            if (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 = ($_POST['id'][$_POST['products_id'][$i]]) ? $_POST['id'][$_POST['products_id'][$i]] : '';

                                            if (is_object($econda)) {
                                                    $old_quantity = $_SESSION['wishList']->get_quantity(xtc_get_uprid($_POST['products_id'][$i], $_POST['id'][$i]));
                                                    $econda->_updateProduct($_POST['products_id'][$i], $cart_quantity, $old_quantity);
                                            }

                                            $_SESSION['wishList']->add_cart($_POST['products_id'][$i], $cart_quantity, $attributes, false);
                                            unset($cart_quantity);

                                            $goto = 'wish_list.php';

                                            }
                                    }
                                    else //CART ############
                                    {
                                            if (in_array($_POST['products_id'][$i], (is_array($_POST['cart_delete']) ? $_POST['cart_delete'] : array()))) {
                                                    $_SESSION['cart']->remove($_POST['products_id'][$i]);

                                            if (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 = ($_POST['id'][$_POST['products_id'][$i]]) ? $_POST['id'][$_POST['products_id'][$i]] : '';

                                            if (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);
                                    } //END wishlist/cart ############
                            }
                            }
     
    [...]
    dies ist meine \includes\cart_actions.php

    Code: PHP  [Auswählen]
    <?php

    /* -----------------------------------------------------------------------------------------
       $Id: cart_actions.php 168 2007-02-06 14:11:42Z mzanier $

       XT-Commerce - community made shopping
       http://www.(( Wir dulden keine kommerziellen Werbelinks - Bitte <a href="index.php?topic=3013.0">Forenregeln</a> beachten! ))

       Copyright (c) 2003 XT-Commerce
       -----------------------------------------------------------------------------------------
       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

       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
       ---------------------------------------------------------------------------------------*/


    // Shopping cart actions
    if (isset ($_GET['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));
            }

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

            switch ($_GET['action']) {
                    // customer wants to update the product quantity in their shopping cart

        case 'update_product' :
            $_SESSION['alter'] = false;
            if (isset ($_POST['plus']) && array_sum($_POST['plus'])> 0) {
                foreach($_POST['plus'] as $key => $value) {
                    $attributes = ($_POST['id'][$_POST['products_id'][$key]]) ? $_POST['id'][$_POST['products_id'][$key]] : '';
                    $_SESSION['cart']->add_cart($_POST['products_id'][$key], xtc_remove_non_numeric($_POST['cart_quantity'][$key] + 1), $attributes, false);
                }
            } elseif (isset ($_POST['minus']) && array_sum($_POST['minus'])> 0) {
                foreach($_POST['minus'] as $key => $value) {
                    if ($_POST['cart_quantity'][$key] == '1') {
                        $_SESSION['cart']->remove($_POST['products_id'][$key]);
                    } else {
                        $attributes = ($_POST['id'][$_POST['products_id'][$key]]) ? $_POST['id'][$_POST['products_id'][$key]] : '';
                        $_SESSION['cart']->add_cart($_POST['products_id'][$key], xtc_remove_non_numeric($_POST['cart_quantity'][$key] - 1), $attributes, false);
                    }
                }
            } elseif (isset ($_POST['delete']) && array_sum($_POST['delete'])> 0) {
                foreach($_POST['delete'] as $key => $value) {
                    $_SESSION['cart']->remove($_POST['products_id'][$key]);
                }
            } elseif (isset ($_POST['alter'])) {
                $_SESSION['alter'] = true;
                $_SESSION['alter_prod'] = $_POST['alter'];
            } elseif (isset ($_POST['attributes'])) {
              $temp=explode("-",$_POST['attributes']);
              $prod_id = $temp[0];
              $alt = $temp[1];
              $neu = $temp[2];
              $attr_id = $temp[3];
              $attributes = array($attr_id => $neu);
              $_SESSION['cart']->modify_attributes($_POST['products_id'][$prod_id], xtc_remove_non_numeric($_POST['cart_quantity'][$prod_id]), $attributes, false);
            } else {
              for ($i = 0, $n = sizeof($_POST['products_id']); $i <$n; $i++) {
                if (in_array($_POST['products_id'][$i], (is_array($_POST['cart_delete']) ? $_POST['cart_delete'] : array ()))) {
                  $_SESSION['cart']->remove($_POST['products_id'][$i]);

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

                  $_SESSION['cart']->add_cart($_POST['products_id'][$i], xtc_remove_non_numeric($_POST['cart_quantity'][$i]), $attributes, false);
                }
              }
            }
                            xtc_redirect(xtc_href_link($goto, xtc_get_all_get_params($parameters), 'SSL'));
            break;
                            // customer adds a product from the products page
                    case 'add_product' :
                            if (isset ($_POST['products_id']) && is_numeric($_POST['products_id'])) {
                                    if ($_POST['products_qty']> MAX_PRODUCTS_QTY)
                                            $_POST['products_qty'] = MAX_PRODUCTS_QTY;

                                    if (is_object($econda)) {
                                            $econda->_emptyCart();
                                            $old_quantity = $_SESSION['cart']->get_quantity(xtc_get_uprid($_POST['products_id'], $_POST['id']));
                                            $econda->_addProduct($_POST['products_id'], $cart_quantity, $old_quantity);
                                    }
    /*
            //BOF - Dokuman - 2010-02-25 - fix 'Fatal error: Call to a member function add_cart()'
                                    //$_SESSION['cart']->add_cart((int) $_POST['products_id'], $_SESSION['cart']->get_quantity(xtc_get_uprid($_POST['products_id'], $_POST['id'])) + $cart_quantity, $_POST['id']);
            if (!is_object($_SESSION['cart'])) {
              $_SESSION['cart'] = new shoppingCart();
            }
            $_SESSION['cart']->add_cart((int) $_POST['products_id'], $_SESSION['cart']->get_quantity(xtc_get_uprid($_POST['products_id'], $_POST['id'])) + xtc_remove_non_numeric($_POST['products_qty']), $_POST['id']);
            //EOF - Dokuman - 2010-02-25 - fix 'Fatal error: Call to a member function add_cart()'
            */

    if($_POST['submit_target'] == 'wishlist') {

           //BOF - Dokuman - 2010-02-25 - fix 'Fatal error: Call to a member function add_cart()'
                                    //$_SESSION['cart']->add_cart((int) $_POST['products_id'], $_SESSION['cart']->get_quantity(xtc_get_uprid($_POST['products_id'], $_POST['id'])) + $cart_quantity, $_POST['id']);
            if (!is_object($_SESSION['wishList'])) {
              $_SESSION['wishList'] = new WishList();
            }
            $_SESSION['wishList']->add_cart((int)$_POST['products_id'], $_SESSION['wishList']->get_quantity(xtc_get_uprid($_POST['products_id'], $_POST['id']))+$_POST['products_qty'], $_POST['id']);
            $goto = 'wish_list.php';
                                    } else {
            if (!is_object($_SESSION['cart'])) {
              $_SESSION['cart'] = new shoppingCart();
            }
            $_SESSION['cart']->add_cart((int) $_POST['products_id'], $_SESSION['cart']->get_quantity(xtc_get_uprid($_POST['products_id'], $_POST['id'])) + xtc_remove_non_numeric($_POST['products_qty']), $_POST['id']);
            //EOF - Dokuman - 2010-02-25 - fix 'Fatal error: Call to a member function add_cart()'
                                    }
                            }
                            xtc_redirect(xtc_href_link($goto, 'products_id=' . (int) $_POST['products_id'] . '&' . xtc_get_all_get_params($parameters)));
                            break;
                    //EOF - Hetfield - 2009.08.18 - Bugfix for numeric quantitys
                    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'])) {
                                    // 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='" . (int) $_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=' . (int) $_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=' . (int) $_GET['BUYproducts_id'], 'NONSSL'));
                                    }

                                    if (GROUP_CHECK == 'true') {

                                            if ($permission['customer_group'] != '1') {
                                                    xtc_redirect(xtc_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . (int) $_GET['BUYproducts_id']));
                                            }
                                    }
                                    if (xtc_has_product_attributes($_GET['BUYproducts_id'])) {
                                            xtc_redirect(xtc_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . (int) $_GET['BUYproducts_id']));
                                    } else {
                                            if (isset ($_SESSION['cart'])) {

                                                    if (is_object($econda)) {
                                                            $econda->_emptyCart();
                                                            $old_quantity = $_SESSION['cart']->get_quantity((int) $_GET['BUYproducts_id']);
                                                            $econda->_addProduct($_GET['BUYproducts_id'], $old_quantity +1, $old_quantity);
                                                    }

                                                    $_SESSION['cart']->add_cart((int) $_GET['BUYproducts_id'], $_SESSION['cart']->get_quantity((int) $_GET['BUYproducts_id']) + 1);
                                            } 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'])) {
                                    if (xtc_has_product_attributes((int) $_GET['pid'])) {
                                            xtc_redirect(xtc_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . (int) $_GET['pid']));
                                    } else {
                                            $_SESSION['cart']->add_cart((int) $_GET['pid'], $_SESSION['cart']->get_quantity((int) $_GET['pid']) + 1);
                                    }
                            }
                            xtc_redirect(xtc_href_link($goto, xtc_get_all_get_params($parameters), 'SSL'));
                            break;
            }
    }
    ?>
     

    ralph_84

    • Fördermitglied
    • Beiträge: 499
    • Geschlecht:
    Re: BETA MODUL: Merkzettel oder Merkliste
    Antwort #11 am: 05. November 2010, 19:27:41
    Hallo Storm 1980

    Also als erstes nach Umbau der Original cart_actions.php sollte das ganze so aussehen!

    Code: PHP  [Auswählen]
    <?php

    /* -----------------------------------------------------------------------------------------
       $Id: cart_actions.php 168 2007-02-06 14:11:42Z mzanier $

       XT-Commerce - community made shopping
       http://www.(( Wir dulden keine kommerziellen Werbelinks - Bitte <a href="index.php?topic=3013.0">Forenregeln</a> beachten! ))

       Copyright (c) 2003 XT-Commerce
       -----------------------------------------------------------------------------------------
       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

       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
       ---------------------------------------------------------------------------------------*/


    // Shopping cart actions
    if (isset ($_GET['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));
            }

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

            switch ($_GET['action']) {

        //BOF - Dokuman - 15.08.2009 - show 'delete button' in shopping cart
                    case 'remove_product':
                            $prd_id = preg_replace('/[^0-9\{\}]/', '', $_GET['prd_id']);
                            $_SESSION['cart'] -> remove($prd_id);
                            xtc_redirect(xtc_href_link($goto, xtc_get_all_get_params($parameters), 'SSL'));
                            break;
        //EOF - Dokuman - 15.08.2009 - show 'delete button' in shopping cart

                                        // customer wants to update the product quantity in their shopping cart
                    case 'update_product' :

                    if (is_object($econda))
                            $econda->_emptyCart();
                    //BOF - Hetfield - 2009.08.18 - Bugfix for numeric quantitys
                            for ($i = 0, $n = sizeof($_POST['products_id']); $i <$n; $i++) {

                                            $cart_quantity = xtc_remove_non_numeric($_POST['cart_quantity'][$i]);

                                            if($_POST['submit_target'] == 'wishlist') //WISHLIST ############
                                    {
                                            if (in_array($_POST['products_id'][$i], (is_array($_POST['cart_delete']) ? $_POST['cart_delete'] : array()))) {
                                                    $_SESSION['wishList']->remove($_POST['products_id'][$i]);

                                            if (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 = ($_POST['id'][$_POST['products_id'][$i]]) ? $_POST['id'][$_POST['products_id'][$i]] : '';

                                            if (is_object($econda)) {
                                                    $old_quantity = $_SESSION['wishList']->get_quantity(xtc_get_uprid($_POST['products_id'][$i], $_POST['id'][$i]));
                                                    $econda->_updateProduct($_POST['products_id'][$i], $cart_quantity, $old_quantity);
                                            }

                                            $_SESSION['wishList']->add_cart($_POST['products_id'][$i], $cart_quantity, $attributes, false);
                                            unset($cart_quantity);

                                            $goto = 'wish_list.php';

                                          }
                                    }
                                    else //CART ############
                                    {
                                            if (in_array($_POST['products_id'][$i], (is_array($_POST['cart_delete']) ? $_POST['cart_delete'] : array()))) {
                                                    $_SESSION['cart']->remove($_POST['products_id'][$i]);

                                            if (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 = ($_POST['id'][$_POST['products_id'][$i]]) ? $_POST['id'][$_POST['products_id'][$i]] : '';

                                            if (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);
                                    } //END wishlist/cart ############
                            }
                            }
                            xtc_redirect(xtc_href_link($goto, xtc_get_all_get_params($parameters), 'SSL'));
                            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']);

                                    if ($cart_quantity> MAX_PRODUCTS_QTY)
                                            $cart_quantity = MAX_PRODUCTS_QTY;

                                    if (is_object($econda)) {
                                            $econda->_emptyCart();
                                            $old_quantity = $_SESSION['cart']->get_quantity(xtc_get_uprid($_POST['products_id'], $_POST['id']));
                                            $econda->_addProduct($_POST['products_id'], $cart_quantity, $old_quantity);
                                    }

    if($_POST['submit_target'] == 'wishlist') {

           //BOF - Dokuman - 2010-02-25 - fix 'Fatal error: Call to a member function add_cart()'
                                    //$_SESSION['cart']->add_cart((int) $_POST['products_id'], $_SESSION['cart']->get_quantity(xtc_get_uprid($_POST['products_id'], $_POST['id'])) + $cart_quantity, $_POST['id']);
            if (!is_object($_SESSION['wishList'])) {
              $_SESSION['wishList'] = new WishList();
            }
            $_SESSION['wishList']->add_cart((int)$_POST['products_id'], $_SESSION['wishList']->get_quantity(xtc_get_uprid($_POST['products_id'], $_POST['id']))+$_POST['products_qty'], $_POST['id']);
            $goto = 'wish_list.php';
                                    } else {
            if (!is_object($_SESSION['cart'])) {
              $_SESSION['cart'] = new shoppingCart();
            }
            $_SESSION['cart']->add_cart((int) $_POST['products_id'], $_SESSION['cart']->get_quantity(xtc_get_uprid($_POST['products_id'], $_POST['id'])) + xtc_remove_non_numeric($_POST['products_qty']), $_POST['id']);
            //EOF - Dokuman - 2010-02-25 - fix 'Fatal error: Call to a member function add_cart()'
                                    }
                            }
                            xtc_redirect(xtc_href_link($goto, 'products_id=' . (int) $_POST['products_id'] . '&' . xtc_get_all_get_params($parameters)));
                            break;
                    //EOF - Hetfield - 2009.08.18 - Bugfix for numeric quantitys
                    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'])) {
                                    // 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='" . (int) $_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=' . (int) $_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=' . (int) $_GET['BUYproducts_id'], 'NONSSL'));
                                    }

                                    if (GROUP_CHECK == 'true') {

                                            if ($permission['customer_group'] != '1') {
                                                    xtc_redirect(xtc_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . (int) $_GET['BUYproducts_id']));
                                            }
                                    }
                                    if (xtc_has_product_attributes($_GET['BUYproducts_id'])) {
                                            xtc_redirect(xtc_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . (int) $_GET['BUYproducts_id']));
                                    } else {
                                            if (isset ($_SESSION['cart'])) {

                                                    if (is_object($econda)) {
                                                            $econda->_emptyCart();
                                                            $old_quantity = $_SESSION['cart']->get_quantity((int) $_GET['BUYproducts_id']);
                                                            $econda->_addProduct($_GET['BUYproducts_id'], $old_quantity +1, $old_quantity);
                                                    }

                                                    $_SESSION['cart']->add_cart((int) $_GET['BUYproducts_id'], $_SESSION['cart']->get_quantity((int) $_GET['BUYproducts_id']) + 1);
                                            } 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'])) {
                                    if (xtc_has_product_attributes((int) $_GET['pid'])) {
                                            xtc_redirect(xtc_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . (int) $_GET['pid']));
                                    } else {
                                            $_SESSION['cart']->add_cart((int) $_GET['pid'], $_SESSION['cart']->get_quantity((int) $_GET['pid']) + 1);
                                    }
                            }
                            xtc_redirect(xtc_href_link($goto, xtc_get_all_get_params($parameters), 'SSL'));
                            break;
            }
    }
    ?>
     
    So desweiteren gab es noch Probleme mit der Session und anpassung der Srache für den Link.

    Habe erneut die Anleitung geändert bzw erweitert.

    Wenn ich jetzt einen Artikel mit Attributen auf den Merkzettel lege, und dann in den Warenkorb

    lande ich auch auf der product_info.php aber mit allen Attributen.

    Das Problem mit der Menge habe ich noch nicht gelöst, aber bin noch auf der suche der Lösung.

    Für das Modul Merkzettelverwaltung habe ich noch keine Zeit, denn als erstes sollte der Merkzettel selber richtig Funktionieren.

    Also wie gesagt Aktuelle Anleitung füge ich an.

    Gruß Ralph

    [EDIT Tomcraft 05.11.2010: Neue Anleitung hier bereitgestellt.]

    ralph_84

    • Fördermitglied
    • Beiträge: 499
    • Geschlecht:
    Re: BETA MODUL: Merkzettel oder Merkliste
    Antwort #12 am: 05. November 2010, 20:47:04
    Hallo habe leider noch was vergessen.

    Zitat
    shop/includes/filenames.php

    suche nach:

    Code: PHP  [Auswählen]
    define('FILENAME_SHOPPING_CART', 'shopping_cart.php');

    darunter einfügen:

    Code: PHP  [Auswählen]
    define('FILENAME_WISHLIST_CART', 'wish_list.php');

    Ist in der letzten Anleitung noch nicht drin, darum hier die neue.

    Gruß Ralph

    cleenbo

    • Neu im Forum
    • Beiträge: 19
    Re: BETA MODUL: Merkzettel oder Merkliste
    Antwort #13 am: 26. November 2010, 11:31:34
    Hallo Gemeinde, hallo Ralf,

    ich will den Merkzettel auch einbauen, nur sieht meine "cart_actions.php" ganz anders aus, da ich das Modul "Komfortabler Warenkorb" eingebaut habe...
    Da ich ein PHP-Dummy bin, hab ich natürlich keinen Plan, wie ich deine Daten in meine "cart_actions.php" einbauen soll! Heieiei, hast du da 'ne Idee?

    Anbei meine "cart_actions.php" zum angucken...

    Wäre Klasse, wenn Du oder einer aus der Gemeinde mir da helfen könnte!!!

    Grüße
    Tom

    Der_Micha

    • Mitglied
    • Beiträge: 167
    Re: BETA MODUL: Merkzettel oder Merkliste
    Antwort #14 am: 26. Dezember 2010, 20:36:35
    Hallo Zusammen,

    ich hab das Modul eingebaut und nach meine Vorstellungen modifiziert, z.B. HTML der Merkliste.
    Dabei bin ich auf ein Problem gestoßen, dass ich leider mit meinen PHP Kenntnissen nicht gelöst bekommen:

    Wenn ich in der Datei"/templates/<template-name>/module/wish_list_order_details.html"
    die Anzeige der Artikelanzahl auskommentiere, kann ich die Artikel nicht mehr aus der Wishlist löschen.  :datz:

    meine "wish_list_order_details.html" sieht so aus:

    Code: PHP  [Auswählen]
    {config_load file="$language/lang_$language.conf" section="shopping_cart"}
    <table class="orderdetails" width="100%" border="1" cellspacing="0" cellpadding="6">
      <tr class="headerrow">
        <td class="left"></td>
        <td class="left">{#text_article#}</td>
       <td class="left">{#text_qty#}</td>
       {php}//<td class="right">{#text_single#}</td>{/php}
        <td class="center">{#text_remove#}</td>
     </tr>

      {foreach name=aussen item=module_data from=$module_content}
      <tr class="{cycle values="contentrow1,contentrow2"}">

            <td align="left" valign="top" class="main">
                    {if $module_data.PRODUCTS_IMAGE!=''}
                    <img src="{$module_data.PRODUCTS_IMAGE}" width="60" height="60" border="0">
                    {/if}
            </td>

        <td class="productname">
                    <strong><a href="{$module_data.PRODUCTS_LINK}">{$module_data.PRODUCTS_NAME}</a></strong>
                    {if $module_data.ATTRIBUTES!=''}
                    <table class="productattributes" width="100%" border="0" cellspacing="0" cellpadding="0">
                    {foreach key=key_data item=item_data from=$module_data.ATTRIBUTES}
                    <tr>
                            <td class="attribute"><strong>{$item_data.NAME}:</strong></td>
                            <td class="value">{$item_data.VALUE_NAME}</td>
                    </tr>
                    {/foreach}
                    </table>
           {/if}</td>
        {php}//<td class="quantity">{$module_data.PRODUCTS_QTY}</td>{/php}
        <td class="singleprice">{$module_data.PRODUCTS_SINGLE_PRICE}</td>
        {php}/*
        //DokuMan - 2009-11-03 - use delete button instead of checkbox in template (commented out)
        <td class="delete">{$module_data.BOX_DELETE}{$module_data.BUTTON_DELETE}</td>
        */
    {/php}
        <td class="delete">{$module_data.BUY_NOW}<br>{$module_data.DELETE_ICON}<br>{$module_data.BUTTON_DELETE}</td>
      </tr>
      {/foreach}
    </table>

    Der Eintrag "$module_data.DELETE_ICON" dient nur zu Testzwecken und ist ohne Bedeutung.

    Nehm ich jetzt die Zeile

    Code: PHP  [Auswählen]
    <td class="quantity">{$module_data.PRODUCTS_QTY}</td>

    wieder rein, kann ich die Einträge in der Wishlist löschen.
    Kommentiere ich diese aus, bleibt der Löschvorgang ohne Erfolg.

    Die Definition ist in"/includes/modules/order_details_wishlist.php" und sieht so aus:

    Code: PHP  [Auswählen]
      $module_content[$i]=array(
      'PRODUCTS_NAME'              => $products[$i]['name'].$mark_stock,
       'PRODUCTS_QTY'               => xtc_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="2"') . xtc_draw_hidden_field('products_id[]', $products[$i]['id']),
      'PRODUCTS_MODEL'             => $products[$i]['model'],
      'PRODUCTS_TAX'               => number_format($products[$i]['tax'], TAX_DECIMAL_PLACES),
      'PRODUCTS_IMAGE'             => $image,
      'IMAGE_ALT'                  => $products[$i]['name'],
      'BUTTON_DELETE'                 => xtc_draw_checkbox_field('cart_delete[]', $products[$i]['id']),
      'DELETE_ICON'                => '<a href="'. xtc_href_link(basename($PHP_SELF), 'action=update_product&products_id='.$products[$i]['id']). '">'.  xtc_image('templates/'.CURRENT_TEMPLATE.'/img/button_cart_delete.jpg', 'löschen'). '</a>',
      'PRODUCTS_LINK'              => xtc_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']),
      'PRODUCTS_PRICE'             => $xtPrice->xtcFormat($products[$i]['price']*$products[$i]['quantity'],true),
      'PRODUCTS_SINGLE_PRICE'      => $xtPrice->xtcFormat($products[$i]['price'],true),
      'PRODUCTS_SHORT_DESCRIPTION' => strip_tags(xtc_get_short_description($products[$i]['id'])),
      'ATTRIBUTES' => '',
      'BUY_NOW' => '<a href="' . xtc_href_link(basename($PHP_SELF), xtc_get_all_get_params(array('action')) . 'action=buy_now&BUYproducts_id=' . $products[$i]['id'], 'NONSSL') . '">' . xtc_image_button('button_buy_now_small.gif', TEXT_BUY . TEXT_NOW)
      );

    Kann mir jemand helfen das Problem zu lösen?
    Gruß
    Michael
    0 Antworten
    1678 Aufrufe
    08. März 2017, 09:06:14 von Buggyboy
    3 Antworten
    4098 Aufrufe
    26. Juni 2013, 12:54:28 von Koala
    5 Antworten
    5075 Aufrufe
    06. August 2011, 08:41:15 von franky_n
               
    anything