Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

PRODUCT OUT OF STOCK QUESTION


bksbeat

Recommended Posts

iT is probably something simple I am overlooking, but let me explain what I am trying to do..

 

I am using the Admin, config, stock option to "ensure that when a stock quantity is 0, that product will be marked with "SOLD". Ideally. I would like to have this displayed as soon as the product is displayed (is there a quick fix for this?) and not after they attempt to add to the cart - but I tried to install a contr. or two and had problems so I am trying to keep it as simple as possible.

The "real problem" I seem to be having, though, is when I set a product qty to 0, with the definitions set as below, it, for some reason, still displays a quantity of 1 when the customer adds it to the cart. The sold message does appear, but the quantity needs to be 0, which is what I have set it as in admin?

I am presuming this maybe a min quantity display issue, just not sure where I am suppose to change it...

 

Value Action

Check stock level true

Subtract stock true

Allow Checkout false

Mark product out of stock SOLD

Stock Re-order level 0

 

Any input will be much appreciated

gary

Link to comment
Share on other sites

Do these steps:

 

If stock < 1 then dont display add to cart or Buy now button.

 

if(tep_get_products_stock($products_id) > 0 )

{

show add to cart or Buy now button

}

Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site.

 

Check My About US For who am I and what My company does.

Link to comment
Share on other sites

Hello Satish,

Thanks so much for your reply.

 

1. I am not sure where I am suppose to put this code?

2. Also, and i might be wrong here but I am basing this on what is occuring now, if I remove "buy now" or "add to cart" option then the customer will never see the SOLD, as you currently can only see that when you "add to cart"?

 

 

 

Do these steps:

 

If stock < 1 then dont display add to cart or Buy now button.

 

if(tep_get_products_stock($products_id) > 0 )

{

show add to cart or Buy now button

}

Link to comment
Share on other sites

if(tep_get_products_stock($products_id) > 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>

 

} in product_info.php

 

 

Satish

Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site.

 

Check My About US For who am I and what My company does.

Link to comment
Share on other sites

if(tep_get_products_stock($products_id) > 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>

 

} in product_info.php

 

 

Satish

 

Hi Satish .. the "IF" should have been inside the PHP tags :)

 

I've made some amendments .. so instead of an empty space, it will show the words "SOLD OUT!"

 

In about Line 210-233 of the "product_info.php" file ..

 

<td class="main" align="right">

<?php if(tep_get_products_stock($products_id) > 0 )

{

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

}else{

echo ("<p>SOLD OUT!");

}

?></td>

Link to comment
Share on other sites

Hi Satish .. u are at it ..

 

There still 2 places that will allow the purchase to be made ::

 

Using my site as an example::

1) http://fx1academy.com/oscommerce/shopping_cart.php?sort=3a

Here the "checkout" button is still there .. hence user can still proceed to check out ..

 

2) http://fx1academy.com/oscommerce/index.php?cPath=23

The "Buy Now" is still there .. I found that the file to change is in the "includes\modules\product_listing.php" file ..

 

Do you have any idea how to resolve that? Or is there a built-in feature that will disable all "out of stock" orders?

Link to comment
Share on other sites

Hi Satish .. u are at it ..

 

There still 2 places that will allow the purchase to be made ::

 

Using my site as an example::

1) http://fx1academy.com/oscommerce/shopping_cart.php?sort=3a

Here the "checkout" button is still there .. hence user can still proceed to check out ..

 

2) http://fx1academy.com/oscommerce/index.php?cPath=23

The "Buy Now" is still there .. I found that the file to change is in the "includes\modules\product_listing.php" file ..

 

Do you have any idea how to resolve that? Or is there a built-in feature that will disable all "out of stock" orders?

No built in feature.You need to modify code.

 

Satish

Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site.

 

Check My About US For who am I and what My company does.

Link to comment
Share on other sites

There is already a contribution for this which changes the Buy Now button to a non-functioning Sold Out button. I use it on my site and it works fine.

 

Show Sold Out Items v1.1

 

;)

- :: Jim :: -

- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

Link to comment
Share on other sites

I dont remember where thisoption was but I do remember that when Im out of a certain item it would remove itself from the website completly and when you go into the Admin part it would show as out of stock, does anyone know where that option is? I just cant find it anymore

Link to comment
Share on other sites

  • 2 weeks later...
I dont remember where thisoption was but I do remember that when Im out of a certain item it would remove itself from the website completly and when you go into the Admin part it would show as out of stock, does anyone know where that option is? I just cant find it anymore

I need that option also to remove an item from the site when it is out of stock, does anyone know about this option?

 

Dan

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...