Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Get two stock status, so if one disabled its discounted or the other out of stock


Guest

Recommended Posts

Hard to explain

 

what i have at the moment is then the red / green product status button is inactive (RED) that means the product is discounted so for example

http://shop.kb-online.co.uk/braun-cruzer2-...ver-p-4312.html

that is discounted product and the add to cart button link is disabled so a button with no link. (image no link)

 

when it is (GREEN) active its normal / available,

 

at the moment when a product is out of stock, i have to Manuel add a message to the listing stating out of stock, but i don't want to do this i want to add two status, one for discounted and the other one for out of stock so when a product is out of stock instead of displaying the button add to cart display out of stock with no link like the discounted one does.

 

Thanks for your help

MSN: [email protected]

SKYPE: kb-online

Link to comment
Share on other sites

I am not completely sure what you are looking for, but you might find a solution in the following code (just add it to your product_info.php page where you want it to be displayed):

If ($product_info['products_quantity']==0){
  echo "This product is out of stock, delivery takes 1-2 weeks";
}elseif ($product_info['products_quantity']>=1){
echo "This product is currently in stock.";
}

Editing this to your needs might be what you are looking for.

Link to comment
Share on other sites

  <?php 
						   if($product_info['products_quantity'] <= 0 || $product_info['products_status']==0) 
echo tep_image_button('button_dissconiuted.gif', IMAGE_BUTTON_DISSCONTINUED);
else
echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?>

 

well i want a image to show if stock = 0 'out of stock' and like it does now if inactive shows discounted as a image button.

 

so how would i change the above code so if stock = 0 it shows out of stock button and if inactive shows the discontinued button as it is now.

 

cheers

Link to comment
Share on other sites

<?php

if($product_info['products_status']==0)

echo tep_image_button('button_sold_out.gif', IMAGE_BUTTON_DISSCON);

else

if($product_info['products_quantity'] <= 0)

echo tep_image_button('button_out_of_stock.gif', IMAGE_BUTTON_SOLD_OUT);

 

else

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

 

 

i worked it out, its above

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...