Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18
  1. #11
    Join Date
    May 2006
    Posts
    98
    Plugin Contributions
    0

    Default Re: Fractional Quantities

    Eek - last time I switched to Classic someone lost their shopping cart and they were none too pleased with my antics...

    I can reproduce the problem myself because I've set up an account. If I select a quantity of 4 when there are only 3 in stock and then go to the shopping cart page, it no longer displays the warning that I need to adjust my order quantities. It used to show this warning along with *** next to the product in question, but it's no longer displaying the warning or the ***. Then, if I click on "Go to Checkout" it just sends me right back to the Shopping Cart page. This was working earlier today, so I know it's something I must have done...

    I searched in the DTK for "out of stock" and didn't see any files there I remember working with this morning, so that's why I thought maybe this minimum stock issue may have affected it...

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

    Default Re: Fractional Quantities

    Sounds like you cut out some code or changed a define or something ...

    Do you happen to have Beyond Compare from scootersoftware.com where you can compare a clean Full Zen Cart v1.3.0.2 to your files from your site?

    The functionality appears to be there ... but not the message ...

    Do a search in the Tools ... Developer's Tool Kit ... in the bottom input box for:
    OUT_OF_STOCK_CANT_CHECKOUT

    See where the defines are and where this is used ...

    Make sure that the defines are not blank ...

    Make sure that it is referenced in the tpl_shopping_cart_default.php ... this includes if you have an override file being used ...

    Also search for:
    STOCK_MARK_PRODUCT_OUT_OF_STOCK

    Make sure that is defined as well ...
    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. #13
    Join Date
    May 2006
    Posts
    98
    Plugin Contributions
    0

    Default Re: Fractional Quantities

    Thanks Linda. I couldn't find anything obvious to me, but then I know nothing about what I'm looking for! I went ahead and installed the full 1.3.02 and it seems to have fixed the problem. Thanks again for all your help and patience!

  4. #14
    Join Date
    Dec 2005
    Posts
    21
    Plugin Contributions
    0

    Default Re: Fractional Quantities

    Hi there, I found the answer to my qn here about having fractional quantities thanks, and it's working but now I get the following message:

    Please update your order ...
    Product Name: Carpet A ... Quantity Units errors -
    You ordered a total of: 100.1 Min: 0.1 *Mixed Option Values is ON

    I previously had Mixed Option Values is OFF and got the same message with OFF instead of ON

    Can you tell me what have I done wrong?

    Thanks

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

    Default Re: Fractional Quantities

    Have you an URL that we can look at?
    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!

  6. #16
    Join Date
    Dec 2005
    Posts
    21
    Plugin Contributions
    0

    Default Re: Fractional Quantities

    Sorry Ajeh I've been tied up with other things...

    Yes, the URL is http://www.spectra-media.net.nz/clie...&products_id=1

    or go to http://www.spectra-media.net.nz/clie...lery/index.php and select Carpet A

    EDITED: Never, ever post the zen_id or zenAdminID (session id) in a forum, email, newsgroup, newsletter, advertisement, etc. etc. etc. or you will be doomed ...
    Last edited by Ajeh; 2 Oct 2006 at 03:15 AM.

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

    Default Re: Fractional Quantities

    This needs to be done carefully ... and well tested ...

    Edit the function:
    /includes/functions/functions_prices.php

    You need to change two of the functions ... so make sure you have a backup of this file before attempting this to test it ...

    Change the function zen_get_products_quantity_min_units_display to read:
    PHP Code:
    ////
    // Return a products quantity minimum and units display
      
    function zen_get_products_quantity_min_units_display($product_id$include_break true$shopping_cart_msg false) {
        
    $check_min zen_get_products_quantity_order_min($product_id);
        
    $check_units zen_get_products_quantity_order_units($product_id);

        
    $the_min_units='';

        if (
    $check_min != or $check_units != 1) {
          if (
    $check_min != 1) {
            
    $the_min_units .= PRODUCTS_QUANTITY_MIN_TEXT_LISTING ' ' $check_min;
          }
          if (
    $check_units != 1) {
            
    $the_min_units .= ($the_min_units ' ' '' ) . PRODUCTS_QUANTITY_UNIT_TEXT_LISTING ' ' $check_units;
          }

          
    $chk_mix zen_get_products_quantity_mixed($product_id);
          if ((
    $check_min or $check_units 0) and !$chk_mix) {
            if (
    $include_break == true) {
              
    $the_min_units .= '<br />' . ($shopping_cart_msg == false TEXT_PRODUCTS_MIX_OFF TEXT_PRODUCTS_MIX_OFF_SHOPPING_CART);
            } else {
              
    $the_min_units .= '&nbsp;&nbsp;' . ($shopping_cart_msg == false TEXT_PRODUCTS_MIX_OFF TEXT_PRODUCTS_MIX_OFF_SHOPPING_CART);
            }
          } else {
            
    // only show if attributes exist
            
    if ($chk_mix != 'none') {
              if (
    $include_break == true) {
                
    $the_min_units .= '<br />' . ($shopping_cart_msg == false TEXT_PRODUCTS_MIX_ON TEXT_PRODUCTS_MIX_ON_SHOPPING_CART);
              } else {
                
    $the_min_units .= '&nbsp;&nbsp;' . ($shopping_cart_msg == false TEXT_PRODUCTS_MIX_ON TEXT_PRODUCTS_MIX_ON_SHOPPING_CART);
              }
            }
          }
        }

        
    // quantity max
        
    $check_max zen_get_products_quantity_order_max($product_id);

        if (
    $check_max != 0) {
          if (
    $include_break == true) {
            
    $the_min_units .= ($the_min_units != '' '<br />' '') . PRODUCTS_QUANTITY_MAX_TEXT_LISTING '&nbsp;' $check_max;
          } else {
            
    $the_min_units .= ($the_min_units != '' '&nbsp;&nbsp;' '') . PRODUCTS_QUANTITY_MAX_TEXT_LISTING '&nbsp;' $check_max;
          }
        }

        return 
    $the_min_units;
      } 
    Change the function zen_get_products_quantity_mixed to read:
    PHP Code:
    ////
    // Return a product mixed setting
    // TABLES: products
      
    function zen_get_products_quantity_mixed($product_id) {
        global 
    $db;

    // don't check for mixed if not attributes
        
    if (zen_has_product_attributes($product_id) == true) {
          
    $the_products_quantity_mixed $db->Execute("select products_id, products_quantity_mixed from " TABLE_PRODUCTS " where products_id = '" . (int)$product_id "'");
          if (
    $the_products_quantity_mixed->fields['products_quantity_mixed'] == '1') {
            
    $look_up true;
          } else {
            
    $look_up false;
          }
        } else {
          
    $look_up 'none';
        }

        return 
    $look_up;
      } 
    Be sure to back up the function first before attempting this ...
    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!

  8. #18
    Join Date
    Dec 2005
    Posts
    21
    Plugin Contributions
    0

    Default Re: Fractional Quantities

    Thanks Linda, I tried these two code changes on my includes\functions\custom1\functions_prices.php file but the problem seems to be still there as you can see at http://www.spectra-media.net.nz/clie...lery/index.php selecting Carpet A with a fractional qty entered into the Add to Cart button. I've appended the relevant page code below so you can see if I've amended it right.

    By the way...was the message "EDITED: Never, ever post the zen_id or zenAdminID (session id) in a forum, email, newsgroup, newsletter, advertisement, etc. etc. etc. or you will be doomed ... " intended for me? I don't understand what this means??

    Cheers


    -----------------------------------------
    / Return a product's quantity box status
    // TABLES: products
    function zen_get_products_qty_box_status($product_id) {
    global $db;

    $the_products_qty_box_status = $db->Execute("select products_id, products_qty_box_status from " . TABLE_PRODUCTS . " where products_id = '" . (int)$product_id . "'");
    return $the_products_qty_box_status->fields['products_qty_box_status'];
    }

    ////
    // Return a product mixed setting
    // TABLES: products
    function zen_get_products_quantity_mixed($product_id) {
    global $db;

    // don't check for mixed if not attributes
    if (zen_has_product_attributes($product_id) == true) {
    $the_products_quantity_mixed = $db->Execute("select products_id, products_quantity_mixed from " . TABLE_PRODUCTS . " where products_id = '" . (int)$product_id . "'");
    if ($the_products_quantity_mixed->fields['products_quantity_mixed'] == '1') {
    $look_up = true;
    } else {
    $look_up = false;
    }
    } else {
    $look_up = 'none';
    }

    return $look_up;
    }


    ////
    // Return a products quantity minimum and units display
    function zen_get_products_quantity_min_units_display($product_id, $include_break = true, $shopping_cart_msg = false) {
    $check_min = zen_get_products_quantity_order_min($product_id);
    $check_units = zen_get_products_quantity_order_units($product_id);

    $the_min_units='';

    if ($check_min != 1 or $check_units != 1) {
    if ($check_min != 1) {
    $the_min_units .= PRODUCTS_QUANTITY_MIN_TEXT_LISTING . '&nbsp;' . $check_min;
    }
    if ($check_units != 1) {
    $the_min_units .= ($the_min_units ? ' ' : '' ) . PRODUCTS_QUANTITY_UNIT_TEXT_LISTING . '&nbsp;' . $check_units;
    }

    $chk_mix = zen_get_products_quantity_mixed($product_id);
    if (($check_min > 0 or $check_units > 0) and !$chk_mix) {
    if ($include_break == true) {
    $the_min_units .= '<br />' . ($shopping_cart_msg == false ? TEXT_PRODUCTS_MIX_OFF : TEXT_PRODUCTS_MIX_OFF_SHOPPING_CART);
    } else {
    $the_min_units .= '&nbsp;&nbsp;' . ($shopping_cart_msg == false ? TEXT_PRODUCTS_MIX_OFF : TEXT_PRODUCTS_MIX_OFF_SHOPPING_CART);
    }
    } else {
    // only show if attributes exist
    if ($chk_mix != 'none') {
    if ($include_break == true) {
    $the_min_units .= '<br />' . ($shopping_cart_msg == false ? TEXT_PRODUCTS_MIX_ON : TEXT_PRODUCTS_MIX_ON_SHOPPING_CART);
    } else {
    $the_min_units .= '&nbsp;&nbsp;' . ($shopping_cart_msg == false ? TEXT_PRODUCTS_MIX_ON : TEXT_PRODUCTS_MIX_ON_SHOPPING_CART);
    }
    }
    }
    }

    // quantity max
    $check_max = zen_get_products_quantity_order_max($product_id);

    if ($check_max != 0) {
    if ($include_break == true) {
    $the_min_units .= ($the_min_units != '' ? '<br />' : '') . PRODUCTS_QUANTITY_MAX_TEXT_LISTING . '&nbsp;' . $check_max;
    } else {
    $the_min_units .= ($the_min_units != '' ? '&nbsp;&nbsp;' : '') . PRODUCTS_QUANTITY_MAX_TEXT_LISTING . '&nbsp;' . $check_max;
    }
    }

    return $the_min_units;
    }


    ////
    // Return quantity buy now
    function zen_get_buy_now_qty($product_id) {
    global $cart;
    $check_min = zen_get_products_quantity_order_min($product_id);
    $check_units = zen_get_products_quantity_order_units($product_id);
    $buy_now_qty=1;

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. gateways? fractional quantities?
    By cygnus in forum General Questions
    Replies: 2
    Last Post: 17 Nov 2010, 03:49 PM
  2. Can I add Fractional Qty's?
    By pumsd in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 29 Apr 2010, 03:15 AM
  3. Fractional Quantity Rounding Price
    By christianpatrick in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 1 Apr 2009, 03:57 PM
  4. Fractional product quantities
    By Jack000 in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 25 Jan 2008, 02:36 PM
  5. [Done v1.3.7] Error when setting fractional quantity.
    By millo_magno in forum Bug Reports
    Replies: 5
    Last Post: 7 Mar 2007, 05:55 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