Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2007
    Posts
    819
    Plugin Contributions
    0

    Default [done v1.3.9] add selected items to cart - says success even if 0 items selected

    hi all,

    when there is a page with mulitiple items listed, and the user clicks the add selected items to cart ***but the user does not select any items*** the cart still shows the successfully added items to cart box....

    how do i make it show a warning box instead that says you did not select any items?

    thanks

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: add selected items to cart

    What is your setting for Admin->Configuration->My Store->Display Cart After Adding Product ?
    What version of Zen Cart?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Feb 2007
    Posts
    819
    Plugin Contributions
    0

    Default Re: add selected items to cart

    display cart after adding items - false
    zen cart version - 1.3.7

  4. #4
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: add selected items to cart

    /includes/classes/shopping_cart.php
    at line 1706 you have the following section of code.
    Make the three alterations shown:
    Code:
      function actionMultipleAddProduct($goto, $parameters) {
        global $messageStack;
        $addCount = 0;
        while ( list( $key, $val ) = each($_POST['products_id']) ) {
          if ($val > 0) {
            $adjust_max = false;
            $prodId = $key;
            $qty = $val;
            $add_max = zen_get_products_quantity_order_max($prodId);
            $cart_qty = $this->in_cart_mixed($prodId);
            $new_qty = $this->adjust_quantity($qty, $prodId, 'shopping_cart');
    
            if (($add_max == 1 and $cart_qty == 1)) {
              // do not add
              $adjust_max= 'true';
            } else {
              // adjust quantity if needed
              if (($new_qty + $cart_qty > $add_max) and $add_max != 0) {
                $adjust_max= 'true';
                $new_qty = $add_max - $cart_qty;
              }
              $this->add_cart($prodId, $this->get_quantity($prodId)+($new_qty));
              $addCount++;
            }
            if ($adjust_max == 'true') {
              $messageStack->add_session('shopping_cart', ERROR_MAXIMUM_QTY . ' C: - ' . zen_get_products_name($prodId), 'caution');
            }
          }
        }
    // display message if all is good and not on shopping_cart page
        if ($addCount && DISPLAY_CART == 'false' && $_GET['main_page'] != FILENAME_SHOPPING_CART) {
          $messageStack->add_session('header', SUCCESS_ADDED_TO_CART_PRODUCTS, 'success');
        }
        zen_redirect(zen_href_link($goto, zen_get_all_get_params($parameters)));
      }
    I've moved this to the bug reports area, as resolution.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Feb 2007
    Posts
    819
    Plugin Contributions
    0

    Default Re: add selected items to cart

    Thanks. That fixed it. :-)

 

 

Similar Threads

  1. v139h custom 'add selected items to cart' button
    By skylab001 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 13 Apr 2012, 02:29 AM
  2. Getting rid of add selected items to cart
    By scastro in forum Customization from the Admin
    Replies: 9
    Last Post: 2 Jul 2010, 04:25 AM
  3. Added selected to cart success even when zero
    By micmed in forum General Questions
    Replies: 2
    Last Post: 20 Oct 2008, 09:13 PM
  4. Blank Page on Add Selected Items to Cart
    By dejavu in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 15 Apr 2008, 09:54 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR