Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Jul 2008
    Posts
    4
    Plugin Contributions
    0

    Default Re: Mixed Options for multiple quantities error

    Quote Originally Posted by DrByte View Post

    Thanks Dr. Byte! That same fixed worked here!

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

    Default Re: Mixed Options for multiple quantities error

    DrByte is my hero! ... and fortunately has a younger brain than I ...
    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!

  3. #3
    Join Date
    Aug 2008
    Posts
    12
    Plugin Contributions
    0

    application error Re: Mixed Options for multiple quantities error

    tg11 & others,


    I have a question on the code that you posted. I understand that everyone used the code and it is working. For some odd reason it is making my website blank. when I take out the code, my whole website is back the way it was. When I checked out the code I see some similar code when I download the product matrix grid module except it does not solve the problem regarding the mixed options for multiple quantities error. The current code gives the end user options in purchasing the single product but they will receive the multiple quantities error. The code that I have in my shopping cart is:

    Lines: 1545 to 1588
    Code:
    /**
       * Method to calculate item quantity, bounded the mixed/min units settings
       *
       * @param boolean product id of item to check
       * @return deciaml
       */
      function in_cart_mixed($products_id) {
        global $db;
        // if nothing is in cart return 0
        if (!is_array($this->contents)) return 0;
    
        // check if mixed is on
        //      $product = $db->Execute("select products_id, products_quantity_mixed from " . TABLE_PRODUCTS . " where products_id='" . (int)$products_id . "' limit 1");
        $product = $db->Execute("select products_id, products_quantity_mixed from " . TABLE_PRODUCTS . " where products_id='" . zen_get_prid($products_id) . "' limit 1");
    
        // if mixed attributes is off return qty for current attribute selection
        if ($product->fields['products_quantity_mixed'] == '0') {
          return $this->get_quantity($products_id);
        }
    
        // compute total quantity regardless of attributes
        $in_cart_mixed_qty = 0;
        $chk_products_id= zen_get_prid($products_id);
    
        // reset($this->contents); // breaks cart
        $check_contents = $this->contents;
        while (list($products_id, ) = each($check_contents)) {
          $test_id = zen_get_prid($products_id);
          if ($test_id == $chk_products_id) {
            $in_cart_mixed_qty += $check_contents[$products_id]['qty'];
          }
        }
        return $in_cart_mixed_qty;
      }
      /**
       * Method to calculate item quantity, bounded the mixed/min units settings
       *
       * @param boolean product id of item to check
       * @return deciaml
       */
      function in_cart_mixed_discount_quantity($products_id) {
        global $db;
        // if nothing is in cart return 0
        if (!is_array($this->contents)) return 0;
    product matrix grid:



    My errors:



    I am not sure what I am doing wrong.

    Any advice?

 

 

Similar Threads

  1. Replies: 3
    Last Post: 30 Jun 2011, 02:04 AM
  2. attributes help for multiple quantities and prices
    By dellvostro in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 15 Oct 2008, 05:11 PM
  3. Replies: 2
    Last Post: 6 Aug 2008, 06:38 PM
  4. Mixed Options?
    By Shooters in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 27 Feb 2008, 12:13 PM
  5. Removing Mixed Options Values text
    By castylx in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 16 Sep 2006, 02:56 PM

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