Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,474
    Plugin Contributions
    88

    Default [Done v1.3.9d] No numeric check for quantity update on shopping_cart page

    v1.3.9b, fresh install.

    When the quantity boxes are shown on the shopping cart (for quantity update), there is no numeric checking for the value typed into the box. Entering a non-numeric value, like 'a', and then pressing the Update icon results in the product being deleted from the cart.

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

    Default Re: No numeric check for quantity update on shopping_cart page

    /includes/classes/shopping_cart.php
    around line 1530 you'll see this section of code.
    Add the new lines as shown:
    Code:
      function actionUpdateProduct($goto, $parameters) {
        global $messageStack;
    
        for ($i=0, $n=sizeof($_POST['products_id']); $i<$n; $i++) {
          $adjust_max= 'false';
          if (!is_numeric($_POST['cart_quantity'][$i]) || $_POST['cart_quantity'][$i] < 0) {
            $messageStack->add_session('header', ERROR_CORRECTIONS_HEADING . ERROR_PRODUCT_QUANTITY_UNITS_SHOPPING_CART . zen_get_products_name($_POST['products_id'][$i]), 'error');
            continue;
          }
    .

    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.

 

 

Similar Threads

  1. Replies: 3
    Last Post: 3 Aug 2015, 05:22 PM
  2. Update currencies and Check for updates not working.....
    By caradelrae in forum General Questions
    Replies: 1
    Last Post: 4 Mar 2008, 06:56 PM
  3. [Done 2.0.0] /includes/classes/shopping_cart.php
    By BlessIsaacola in forum Bug Reports
    Replies: 9
    Last Post: 3 Sep 2007, 08:11 AM

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