Results 1 to 4 of 4

Hybrid View

  1. #1
    Join Date
    Aug 2006
    Posts
    37
    Plugin Contributions
    0

    Default adjust quantity for max qty order in shopping cart

    I have a product X with "Product Qty Maximum:" set to 3
    On a page with multiple products added to the shopping cart, If I try to add 5 to the shopping cart along with some other products, I get the error
    "Qty Adjusted - Maximum Qty Added to Cart - Product name x"
    but I get it not only for product X, but also any products in the cart below product X

    Only the qty for product X gets adjusted...the others are fine even though the error shows up.

    I did some digging and found that the $adjust_max was not set to false in the beginning of the function, and so every product after the product X was also flagged for the error to show up.

    includes/classes/shopping_cart.php

    Original code:

    function actionMultipleAddProduct($goto, $parameters) {
    global $messageStack;
    while ( list( $key, $val ) = each($_POST['products_id']) ) {
    if ($val > 0) {


    add this to line after while starts:
    $adjust_max= 'false';

    my edited code:

    function actionMultipleAddProduct($goto, $parameters) {
    global $messageStack;
    while ( list( $key, $val ) = each($_POST['products_id']) ) {
    $adjust_max= 'false';
    if ($val > 0) {

  2. #2
    Join Date
    Aug 2006
    Posts
    37
    Plugin Contributions
    0

    Default Re: adjust quantity for max qty order in shopping cart

    sorry, forgot to say I'm using v1.3.0.2 with the new security fixes installed also.

  3. #3
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: adjust quantity for max qty order in shopping cart

    Have you an URL for this that we can peek at? I cannot reproduce this error ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: adjust quantity for max qty order in shopping cart

    While I call that a feature ... some might call that a ... umm ... bug ...

    Edit the file:
    /includes/classes/shopping_cart.php

    Around lines 1678 - 1681 you should see:
    PHP Code:
      function actionMultipleAddProduct($goto$parameters) {
        global 
    $messageStack;
        while ( list( 
    $key$val ) = each($_POST['products_id']) ) {
          if (
    $val 0) { 
    Change that to read:
    function actionMultipleAddProduct($goto, $parameters) {
    global $messageStack;
    while ( list( $key, $val ) = each($_POST['products_id']) ) {
    if ($val > 0) {
    $adjust_max = false;
    You are just adding the: $adjust_max = false; below that code ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

 

 

Similar Threads

  1. v151 Adjust minimum quantity in shopping cart
    By linuxguy2 in forum General Questions
    Replies: 4
    Last Post: 19 Jan 2014, 09:26 AM
  2. v139h Shopping Cart Max Qty problem on my 1.3.9h, please help!
    By explorer1979 in forum General Questions
    Replies: 5
    Last Post: 22 Feb 2013, 07:35 AM
  3. Can I get shopping cart to auto update stock quantity to max available
    By WayneStephens in forum Managing Customers and Orders
    Replies: 5
    Last Post: 17 Apr 2010, 05:42 PM
  4. Adjust Quantity in the Shopping Cart
    By voltage in forum Basic Configuration
    Replies: 6
    Last Post: 3 Dec 2006, 04:38 AM

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