Results 1 to 10 of 10

Hybrid View

  1. #1
    Join Date
    Oct 2010
    Posts
    31
    Plugin Contributions
    0

    Default Always "One" in Stock

    Hi Guys,

    I am having fun with Zen-Cart here. Thanks to all people who created it. My website is:
    www.sariucak.com

    I have a question. As you see I am selling stamps. All the stamps I am selling are "always" one item.
    What this means is when a customer buys a stamp from the store. They can only buy one. So I won't bee needing "enter quantity" box in anywhere. I saw a couple of customers adding more than one in quantity, and naturally this action ends up with an alert in their shopping cart saying:
    "Products marked with *** are out of stock.
    Items not in stock will be placed on backorder."

    This alert is a little misinforming. Customers think the item is not in stock.

    When you change the quantity to "1" everything is just fine.

    Is there any way to remove this "adding quantity" from products and shopping cart? or basically from everywhere?
    This ways customers won't get confused...

    Thanks in advance,
    Cenk

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,879
    Plugin Contributions
    96

    Default Re: Always "One" in Stock

    Assuming that each of your products is set up in your admin with "No, do not show quantity box", you could create the file /includes/extra_cart_actions/limit_to_one.php:

    Code:
    global $messageStack;
    
    if (!defined(STOCK_LIMIT_TO_ONE)) {
      define('STOCK_LIMIT_TO_ONE', 'Sorry, your purchase is limited to one of each product.');
    }
    
    if ($_GET['action'] == 'buy_now' || $_GET['action'] == 'add_product') {
      $cart_qty = $_SESSION['cart']->in_cart_mixed($pID);
      if ($cart_qty > 0) {
        $messageStack->add_session('header', STOCK_LIMIT_TO_ONE, 'error');
        zen_redirect(zen_href_link($goto, zen_get_all_get_params($parameters)));
      }
    }
    That will "intercept" any changes (other than delete requests) to the cart, check to see if the product is already in the cart and, if so, display a message to let the customer know what's going on and negate that update.

  3. #3
    Join Date
    Oct 2010
    Posts
    31
    Plugin Contributions
    0

    Default Re: Always "One" in Stock

    Thanks for the help...
    Unfortunately My items haven't been setup as "No, do not show quantity box".
    If there is no other easy way, I have to revise all the products to the one above and then create a new php file with the code you gave and copy/move the php file to the folder "/includes/extra_cart_actions"

    Am I correct?

    By the way my store's direct link is: http://www.sariucak.com/store/

    The link in my first message is incomplete. Sorry about that.


    Thanks
    Cenk
    Last edited by yellowaircraft; 31 Dec 2010 at 04:18 PM.

  4. #4
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Always "One" in Stock

    The text
    Products marked with *** are out of stock.
    Items not in stock will be placed on backorder.
    Can be changed to something like
    Products marked with *** are unique one of a kind items.
    Only one is available for purchase.
    Please revise your quantity to 1
    You can also in the product setup screen try setting the "max" to 1
    Zen-Venom Get Bitten

  5. #5
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,879
    Plugin Contributions
    96

    Default Re: Always "One" in Stock

    Quote Originally Posted by yellowaircraft View Post
    Thanks for the help...
    Unfortunately My items haven't been setup as "No, do not show quantity box".
    If there is no other easy way, I have to revise all the products to the one above and then create a new php file with the code you gave and copy/move the php file to the folder "/includes/extra_cart_actions"

    Am I correct?

    By the way my store's direct link is: http://www.sariucak.com/store/

    The link in my first message is incomplete. Sorry about that.


    Thanks
    Cenk
    What you've said is correct. If your products aren't set with "No, do not show quantity box", then a customer can (1) specify more than one of the product on the product_info page and (2) change the quantity from the shopping_cart page.

    There's probably a SQL command lurking out there that can change the quantity-box setting on *all* products; I'll give it a look-see later today if you'd like.

  6. #6
    Join Date
    Oct 2010
    Posts
    31
    Plugin Contributions
    0

    Default Re: Always "One" in Stock

    Thanks lat9,
    What you told is working for me now.

    I am half way thru revising the products to "No, do not show quantity box".

    While I was doing that. I tried something else. I added one item to my cart. Then I went back to the same item added it again.
    When I go back to my shopping cart, item quantity shows "2". And the warning sign "Products marked with *** are out of stock.
    Items not in stock will be placed on backorder." comes back again.

    And as there is no "revisible" quantity box in the shopping cart anymore, customer has to delete the item and add it back.

    As far as I read from the forum there is no way to prevent a customer to add same item twice into the shopping cart (or more than one customer adding same product at the same time) unless you write a custom code.

    I feel like I am getting into details a little bit more than a regular zen-cart user but considering my customers' age (mostly 50 to 65) and computer knowledge I do not want them to find and fall into any cracks (by mistake of course) in the system.

    Thanks again lat9,

    Thanks to you too Kobra, I will try your suggestion too. It's a good idea that this warning should be specific to my needs.

    Cheers
    Cenk

  7. #7
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Always "One" in Stock

    Try the "max" 1 setting also
    Zen-Venom Get Bitten

 

 

Similar Threads

  1. Replies: 20
    Last Post: 26 Oct 2011, 12:21 AM
  2. "Always" in stock & "one-off" stock items
    By Fidz in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 13 Feb 2010, 12:16 PM
  3. fedex setting "always free" weights to "0" on upgrade..help please
    By wootoot1234 in forum Built-in Shipping and Payment Modules
    Replies: 9
    Last Post: 14 Jan 2009, 01:11 AM
  4. Certificates priced by attribute always are "out of stock" in cart
    By lemuria in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 1
    Last Post: 17 Jun 2007, 04:17 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