Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

When quantity of item goes to zero, I want it...


Guest

Recommended Posts

I suspect this may be something simple in the Admin page to accomplish, but I'm not sure.

 

I did a test-purchase of an item with a quantity of one and it went smoothly, and the item quantity then dropped to zero. However....I went back in as another customer and tried to purchase the same item, now of zero quantity, and checkout allowed it to be purchased. Do NOT want that happening.

 

I still want the item to be available for viewing on the website when the quantity is zero.....I just don't want a customer to be able to complete checkout and attempt to purchase it. What do I do? :'(

Link to comment
Share on other sites

I suspect this may be something simple in the Admin page to accomplish, but I'm not sure. 

 

I did a test-purchase of an item with a quantity of one and it went smoothly, and the item quantity then dropped to zero.  However....I went back in as another customer and tried to purchase the same item, now of zero quantity, and checkout allowed it to be purchased.  Do NOT want that happening.

 

I still want the item to be available for viewing on the website when the quantity is zero.....I just don't want a customer to be able to complete checkout and attempt to purchase it.  What do I do?  :'(

This can be done in the admin under configuration - stock. you can specify it to display or not when levels reach 0, also tell you when your out of stock

Link to comment
Share on other sites

This can be done in the admin under configuration - stock.  you can specify it to display or not when levels reach 0, also tell you when your out of stock

 

 

Hi Shane,

 

Thanks for your reply. I've messed around a bit this evening with the admin controls regarding stock/inventory. I set the 'allow checkout' to false....so, when I go in and try to purchase an item with a quantity of zero, it basically throws the checkout into a loop....and will not allow the buyer to proceed, which is great.

 

I set the out of stock re-order level to zero.....but it doesn't put a screeching halt to anyone attempting to proceed with checkout. What am I doing wrong?

 

I guess what I want...is for the item to remain available for viewing in the catalog, but with a noticeable 'OUT OF STOCK' assigned to it, not just a plain old zero. And if someone attempts to put it in their cart...they're issued a screen, a warning of sorts, that the item is unavailable or out of stock at this time, so...hit continue to keep shopping. Hope I'm making myself clear. Thanks very much for your help!

Link to comment
Share on other sites

Hi Shane,

 

Thanks for your reply.  I've messed around a bit this evening with the admin controls regarding stock/inventory.  I set the 'allow checkout' to false....so, when I go in and try to purchase an item with a quantity of zero, it basically throws the checkout into a loop....and will not allow the buyer to proceed, which is great.

 

I set the out of stock re-order level to zero.....but it doesn't put a screeching halt to anyone attempting to proceed with checkout.  What am I doing wrong?

 

I guess what I want...is for the item to remain available for viewing in the catalog, but with a noticeable 'OUT OF STOCK' assigned to it, not just a plain old zero.  And if someone attempts to put it in their cart...they're issued a screen, a warning of sorts, that the item is unavailable or out of stock at this time, so...hit continue to keep shopping.  Hope I'm making myself clear.  Thanks very much for your help!

Now I use CRE loaded 6, which is a supercharged version of oscommerce so it may be different to the standard version but under the "mark product out of stock" section you can make it read whatever you want and it will do just as you say

Link to comment
Share on other sites

Hi Shane,

 

Thanks for your reply.  I've messed around a bit this evening with the admin controls regarding stock/inventory.  I set the 'allow checkout' to false....so, when I go in and try to purchase an item with a quantity of zero, it basically throws the checkout into a loop....and will not allow the buyer to proceed, which is great.

 

I set the out of stock re-order level to zero.....but it doesn't put a screeching halt to anyone attempting to proceed with checkout.  What am I doing wrong?

 

I guess what I want...is for the item to remain available for viewing in the catalog, but with a noticeable 'OUT OF STOCK' assigned to it, not just a plain old zero.  And if someone attempts to put it in their cart...they're issued a screen, a warning of sorts, that the item is unavailable or out of stock at this time, so...hit continue to keep shopping.  Hope I'm making myself clear.  Thanks very much for your help!

 

 

I use this to not display the add to cart button in product_info if the stock is not higher than 0

 

 

<?php if ($product_info['products_quantity'] > 0)

 

{ ?>

<td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>

<?php } ?>

 

 

then you can also put a text saying it is sold anywhere like this :

 

<?php

 

if ($product_info['products_quantity'] < 1) { ?>

<tr>

<td align="center" class="sold_out_text"><?php echo TEXT_SOLD_OUT ?>< /td> </tr>

<?php } ?>

Treasurer MFC

Link to comment
Share on other sites

I use this to not display the add to cart button in product_info if the stock  is not higher than 0

                <?php if ($product_info['products_quantity'] > 0)

 

                { ?>

                <td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>

                <?php } ?>

then you can also put a text saying it is sold anywhere like this :

 

<?php

 

if ($product_info['products_quantity'] < 1) {  ?>

<tr>

<td align="center" class="sold_out_text"><?php echo TEXT_SOLD_OUT ?>< /td>          </tr>

<?php } ?>

looks like the standard version is different! I'll just butt out -sorry

Link to comment
Share on other sites

YOu could just:

 

check stock level >>true

subtact stock >>true

allow checkout >>false

 

:::

false will tell the system to not allow anyone to buy it if it is out of stock

 

 

Hi! My buddy!

 

Actually...I have the settings just as you suggest. However, it does allow a buyer to put the item of zero quantity in their shopping cart and proceed with checkout. Some message about changing the quantity number to proceed.......??? It all ends up being messy and ugly with the customer changing the quantity number to whatever they like only to end up, time and time again, back at the initial checkout screen with the warning that there is 'insufficient supply' or something like that.

 

What I'd like is.......when someone is browsing thru the store....they come across an item that is clearly marked 'out of stock' or 'temporarily unavailable'...something like that. All I'm getting is a big fat ZERO for quantity on hand. It's funny.....because when I search for help on this topic....I'm seeing so many posts from people who want to get RID of the 'out of stock' statement on their item listings. What they're trying to get rid of is exactly what I want! LOL!

Link to comment
Share on other sites

Hmmm

 

Well I just finished testing it for my self for the very first time....

 

I changed one of the products quantity to '0'...and went to try to buy it...When I went to add it to the shopping cart... I got this:

 

The product itself had 3 '***' next to it and written below:

Products marked with *** dont exist in desired quantity in our stock.

Please alter the quantity of products marked with (***), Thank you

 

Since my quantity ..while trying to check it out was 1...I was not allowed to buy it. Now you can alter the text above to whatever you want...

 

However, it does allow a buyer to put the item of zero quantity in their shopping cart and proceed with checkout. Some message about changing the quantity number to proceed.......???

 

and just to be safe...I even ..pretending to be a customer..changed the quantity to '0' and when I hit update..and refreshed back to '1' in quantity field....

 

to sum it up.... I was NOT allowed to add to cart >> meaning I could not buy it.

 

If you want to see what I mean, you can test it out at my clients store here:

http://www.thelighthousebooks.com/catalog/product_info.php?products_id=45

( I will only leave it like that for a day or two )

:blush:

Link to comment
Share on other sites

  • 6 months later...
Hmmm

 

Well I just finished testing it for my self for the very first time....

 

I changed one of the products quantity to '0'...and went to try to buy it...When I went to add it to the shopping cart... I got this:

 

The product itself had 3 '***' next to it and written below:

Since my quantity ..while trying to check it out was 1...I was not allowed to buy it.  Now you can alter the text above to whatever you want...

and just to be safe...I even ..pretending to be a customer..changed the quantity to '0' and when I hit update..and refreshed back to '1' in quantity field....

 

to sum it up.... I was NOT allowed to add to cart >> meaning I could not buy it.

 

If you want to see what I mean, you can test it out at my clients store here:

http://www.thelighthousebooks.com/catalog/product_info.php?products_id=45

( I will only leave it like that for a day or two )

:blush:

 

 

For anyone else looking for the text to be changed it is in catalog/includes/languages/shopping_cart.php

 

I changed it to define('OUT_OF_STOCK_CANT_CHECKOUT', 'Products marked with ' . STOCK_MARK_PRODUCT_OUT_OF_STOCK . ' are not in stock or are not available for purchase.<br>Please remove any items marked with ' . STOCK_MARK_PRODUCT_OUT_OF_STOCK . ' from your basket. Thank you.'); :thumbsup:

Link to comment
Share on other sites

  • 10 months later...
YOu could just:

 

check stock level >>true

subtact stock >>true

allow checkout >>false

 

:::

false will tell the system to not allow anyone to buy it if it is out of stock

 

I'm creating a dvd-rental site which uses the quantity to display "rented" or "in stock" and changed the above attributes:

 

Check stock level true

Subtract stock true

Allow Checkout false

 

The error message comes up when qty=0... however when someone goes through the checkout, the product qty automatically set to 0.

 

My problem is, this function also causes the 'item status' set to 'set inactive'. Is there a way to get the stock to automatically be deducted (qty=0) without the item status changing?

 

Thank you

Link to comment
Share on other sites

  • 4 months later...
I'm creating a dvd-rental site which uses the quantity to display "rented" or "in stock" and changed the above attributes:

 

Check stock level true

Subtract stock true

Allow Checkout false

 

The error message comes up when qty=0... however when someone goes through the checkout, the product qty automatically set to 0.

 

My problem is, this function also causes the 'item status' set to 'set inactive'. Is there a way to get the stock to automatically be deducted (qty=0) without the item status changing?

 

Thank you

 

Hi,

 

I'm not sure if anyone helpd you with this. I am doing exacty what you are attempting and I found three bit's of code in the contributions that fixed everything.

 

<<<<<<<<<<<<1>>>>>>>>>>>>>

 

Additional change for hiding 'add to cart' button in product info screen if product is sold out.

 

 

in catalog/product_info.php:

 

FIND

 

<?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?>

 

 

REPLACE

 

 

<?php if ($product_info['products_quantity'] > 0) {

echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART);

}

?>

 

 

<?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?>

 

 

<<<<<<<<<<<<<<2>>>>>>>>>>>>>>>>>>>

 

 

 

Here is how to make items stay displayed in your product listings, even if they are out of stock. Some people reported not being able to do this, while others had just the opposite problem. For my own site, there was no other way except to delete a few lines of code.

 

 

remove these lines from catalog/checkout_process.php:

 

if ( ($stock_left < 1) && (STOCK_ALLOW_CHECKOUT == 'false') ) {

tep_db_query("update " . TABLE_PRODUCTS . " set products_status = // '0' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");

}

 

 

-just put // in front of each line. This will stop the .php file from writing the products_status as out of stock in the database. Glad I figured this out, it was driving me crazy!

 

<<<<<<<<<<<<<<<<<<<3>>>>>>>>>>>>>>>>>>>

 

If the stock gif?s from the site "http://www.electronicweb2001.com/tienda/catalog/catalog/images/sin_stock.gif"

change your images change too .....

so put the images in your own images folder, it is just a better way .....

 

like:

 

http://www.yourpage.com/catalog/catalog/images/sin_stock.gif

 

and

 

http://www.yourpage.com/catalog/catalog/images/en_stock.gif

 

Mark-Aurelius

 

 

 

On Reserve Mod V1.0

Author: David Hanwell

eMail Address: dave at qorn.co.uk

Drop me an eMail with your comments or if you like it, as this is my first writen contrib

 

Modifications:

 

When a product was out of stock, and there was some orders pending on it (Negative Stock) no meesages were shown on the product listing.

 

This modification includes a pair of Gifs instead of the text, and also includes a message when stock is Ok..

 

 

 

 

In catalog/product_info.php

 

 

### RIGHT AFTER THIS CODE: #################################################################

<noscript>

<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>

</noscript>

 

### ADD THIS: ###############################################################################

<br>

<?php

If ($product_info['products_quantity']==0 or $product_info['products_quantity'] < 0){

echo '<br><img src="http://www.electronicweb2001.com/tienda/catalog/catalog/images/sin_stock.gif"><br><br>';

}

else

{

echo '<br><img src="http://www.electronicweb2001.com/tienda/catalog/catalog/images/en_stock.jpg"><br><br>';

 

}

 

 

 

?>

 

################################################################################

#############

 

2. In your Admin section of your site in Configuration/Stock:

Set "Check stock level" to TRUE

Set "Allow checkout" to FALSE

 

<<<<<<<<<<<<<That's it!>>>>>>>>>>>>>>>>>>

 

 

 

I hope this helps but you've probably figured this out by now.

Link to comment
Share on other sites

  • 1 year later...

I've had a similar problem, which I've recently posted about under general support.

 

Wouldn't have posted it if I'd found this topic.

 

The problem I'm having is similar but not quite the same and any help really would be appreciated.

 

We sell clothes, with each item available in a variety of sizes (eg. medium, large, xl). We add a product then add attributes for the sizes which display on the product page. We found a good contribution which allows us to keep up to date stock levels organised by size aswell as product.

 

Our problem is that when for example a size medium sells out, the [out of stock] message no longer appears. I initially thought this was down to us altering stock manually (we sell at events aswell as online) but I'm now wondering if it may be a more general issue that occurrs when stuff sells out.

 

In initial testing the out of stock text displayed and customers weren't able to process their order.

 

That seems to no longer be the case.

 

What I need is for oscommerce to understand that we we edit the stock level for a set size to zero, that it needs to illustrate this to customers and no allow them to make a purchase while allowing them to buy a large or xl.

 

Can this be done and if so, how!?

Link to comment
Share on other sites

  • 1 month later...

I have the same problem here... :blink:

 

The check out page finish the sale even if the stock is zero. It show that the quantity of stock is low, but the check out process can be finished and I don't want that it can be made. :huh:

 

If a product has just 1, the customer will buy just 1 and nothing more. He select 2 or 3 and update the shopping cart. He calculates the prices and can finish the sale!!! Even if I don't have this product in stock. :angry:

 

How I can cancel the checkout process when I don't have the product in stock!?!?!?! :huh:

 

 

Please somebody could help me??? :'(

 

Thanks a lot... ;)

Link to comment
Share on other sites

  • 2 years later...

Hi,

 

The check out page finish the sale even if the stock is zero. It show that the quantity of stock is low, but the check out process can be finished and I don't want that it can be made. :huh:

 

probably you don't need this answer anymore. I give it anyway because I had the same problem and found this page with google.

Even I had ALLOW CHECKOUT set to false checkout was possible without problems. I just got an other hint text after the three stars..

 

Here the solution:

 

Edit the checkout_shipping.php

 

Search for:

// if there is nothing in the customers cart, redirect them to the shopping cart page
 if ($cart->count_contents() < 1) {
   tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
 }

 

AFTER that add this new code:

 

// if there is an item not in stock and checkout not allowed, redirect them to the shopping cart page
if (STOCK_ALLOW_CHECKOUT == 'false') {
	$any_out_of_stock = 0;
	$products = $cart->get_products();
	for ($i=0, $n=sizeof($products); $i<$n; $i++) {
		$stock_check = tep_check_stock($products[$i]['id'], $products[$i]['quantity']);
		if (tep_not_null($stock_check)) {
			$any_out_of_stock = 1;
		}
	}
	if ($any_out_of_stock == 1) {
	tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
	}
}

 

If you set allow checkout to false it checks if there is any item not in stock in the desired quantity.

If there is any, the customer will be redirected to the shopping cart, where the red notification with the three stars is shown.

The code works even if the customer did not checked his shopping cart and goes directly to the ckeckout.

 

Best regards

John

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...