Jump to content
Larry Ullman's Book Forums

Not Showing Product If None In Stock


Recommended Posts

I created the following script so that from the website if the product has no stock it does not show. Which is fine.

 

<?php # Script to show products
$page_title = 'Browse the Products';
require_once ('../mysqli_connect.php');
// shows the product if over 0 in stock
$q="SELECT * FROM product WHERE product_category='fish' AND quantity_stock>'0'";
if (isset($_GET['pid']) && is_numeric($_GET['pid']) ) {
$pid = (int) $_GET['pid'];
if ($pid > 0) { // Overwrite the query:
}
}

 

 

But, search engines are showing the product if it goes from outside of our websites. It is picking up the pid=(the product number)

 

http://www.websiteaddress.co.uk/viewproduct.php?pid=329

 

Any ideas of a way around this? (except for deleting the product)

 

- PHP version 5.3.5

- MYSQLI 5.0.7

Link to comment
Share on other sites

The problem with search engines are that they are outdated almost instantaneously. In your situation, you obviously want your products to be sold, so you want them in Google etc, but when they're out of stock, I wouldn't want them not in Google, because the next day they could be back in stock and many people will be prepared to wait for a product to come back in to buy, which is good for your business. The truth is that removing links from Google isn't actually that quick. You can request its removed from webmaster tools, but I don't know how easy it then is to index the page again. I genuinely think that if it was me i'd show every product but where there was no stock i'd indicate no stock "Out of stock - back soon"

  • Upvote 1
Link to comment
Share on other sites

In addition to Jonathon's comments, I don't think it's great to hide any product unless you're discontinuing it. Amazon allow you to purchase even if the item is not in stock - I'm sure I've done this with two of Larry's new books in the past, they had order early discounted prices.

 

On a recent ecommerce project, I had item pages without stock state "Stock on order" with both a form to enter a contact email address(to be notified when stock was in) and the addition of thumbnail images/links for similar products in stock.

  • Upvote 1
Link to comment
Share on other sites

 Share

×
×
  • Create New...