Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    Feb 2009
    Posts
    138
    Plugin Contributions
    0

    Default “Products marked with *** are out of stock.” Logic Error...

    When a customers orders an amount that is above the available in stock they get this error message:

    “Products marked with *** are out of stock.”

    This statement is inaccurate, since it shows up also when items are in stock, but customers orders over the amount in stock.

    Is there a way (or a mod) for the system to tell the customer by how much they are over stock (ordered minus stock), so that they can manually fix the order quantity?

    Thank you.


    ZC Version 1.3.8a

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

    Default Re: “Products marked with *** are out of stock.” Logic Error...

    You could either customize the function used to display the *** in the functions_lookup.php file:
    Code:
      function zen_check_stock($products_id, $products_quantity) {
    Or, customize the template with the function:
    Code:
      function zen_get_products_stock($products_id) {
    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: v1.5.5]
    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
    Feb 2009
    Posts
    138
    Plugin Contributions
    0

    Default Re: “Products marked with *** are out of stock.” Logic Error...

    Thank you for your reply.

    Note: I am not familiar with php programming, other than simple modifications by looking at others' code.

    First of all, which templates should be modified?

    When I search for STOCK_MARK_PRODUCT_OUT_OF_STOCK I find the following:

    functions_lookups.php
    checkout_confirmation.php
    shopping_cart.php
    paypal_functions.php
    paypaldp.php
    paypalwpp.php

    All of them?

    Thanks.

  4. #4
    Join Date
    Feb 2009
    Posts
    138
    Plugin Contributions
    0

    Default Re: “Products marked with *** are out of stock.” Logic Error...

    Also, I am guessing there is no template override for this....?


    Here is one of the functions you mentioned:

    PHP Code:
      function zen_check_stock($products_id$products_quantity) {
        
    $stock_left zen_get_products_stock($products_id) - $products_quantity;
        
    $out_of_stock '';

        if (
    $stock_left 0) {
          
    $out_of_stock '<span class="markProductOutOfStock">' STOCK_MARK_PRODUCT_OUT_OF_STOCK '</span>';
        }

        return 
    $out_of_stock;
      } 
    If I read this right, the function already calculates the amount over. So it is the return that needs to be modified.
    Right?

  5. #5
    Join Date
    Feb 2009
    Posts
    138
    Plugin Contributions
    0

    Default Re: “Products marked with *** are out of stock.” Logic Error...

    First of all, which templates should be modified?
    I'll answer myself on this one: Just the one Ajeh mentioned (functions_lookups.php). The stock_left return is specified only there.

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

    Default Re: “Products marked with *** are out of stock.” Logic Error...

    NOTE: $stock_left is how much stock is left after taking the current stock and subtracting how much the customer has set in the cart ...

    If you want to say how much stock is available before the calculation is made, that is what the function zen_get_products_stock is for ...
    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: v1.5.5]
    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!

  7. #7
    Join Date
    Feb 2009
    Posts
    138
    Plugin Contributions
    0

    Default Re: “Products marked with *** are out of stock.” Logic Error...

    Yes, I think I prefer going in that direction.

    So, for the return logic to be correct, the system would have to mark the available stock for each item within the shopping cart, along with giving a general error message at the top.

    General error (at top):
    Please adjust your order quantity for the products marked with ***
    Otherwise items not in stock will be placed on backorder.


    Item error:
    Cool item description here

    ***Available in stock: X



    (including line breaks, instead than having *** attached to the description)


    So I would have to edit two lines (piece of cake), and add a custom function within the item (clueless).


    What do you think of the logic as described above, better? Still flawed in some way?


    Thank you

  8. #8
    Join Date
    Feb 2009
    Posts
    138
    Plugin Contributions
    0

    Default Re: “Products marked with *** are out of stock.” Logic Error...

    Or not allow backordering at all and use the current sentence in place "Products marked with *** are out of stock or there are not enough in stock to fill your order.
    Please change the quantity of products marked with (***). Thank you
    "


    So, after after clearing up my thoughts above, here is the revised question:

    How do I insert the In Stock quantity within the shopping cart, either below the description or below the ordered quantity?

  9. #9
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: “Products marked with *** are out of stock.” Logic Error...

    This might save you some trouble, since that message already exists, but only displays if you set Admin->Configuration->Stock->Allow Checkout Out Of Stock? to false.
    .

    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.

  10. #10
    Join Date
    Feb 2009
    Posts
    138
    Plugin Contributions
    0

    Default Re: “Products marked with *** are out of stock.” Logic Error...

    Right right. I changed that settings and found that message.

    In any case the last question still stands. How do I show In Stock within the shopping cart?

    The customer would have no idea what to change the quantity to unless they go back to the catalog, or not at all if the In Stock is not displayed in the catalog (which is not in my case, for several reasons)

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v151 Products marked with *** are out of stock has stopped displaying
    By doooomed in forum General Questions
    Replies: 3
    Last Post: 3 Apr 2013, 05:53 PM
  2. Out of stock products are not marked in my cart
    By alexsmith2709 in forum General Questions
    Replies: 4
    Last Post: 11 Sep 2011, 02:00 AM
  3. Price Marked Out With $0.00 Only On Some Products
    By judah in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 25 Aug 2010, 11:41 PM
  4. Downloads - products marked out of stock???
    By wishy in forum Setting Up Categories, Products, Attributes
    Replies: 11
    Last Post: 20 Feb 2007, 06:53 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