Hi! Here I have a problem that some of the items sold but few are available with expiry date and I don't know, what should I need to do with...need suggestions.
Thanks

Dani AI

Generated

— there are two separate problems here and they need different, predictable workflows: expired (time‑bound/perishable) items and temporary out‑of‑stock gaps. is right that they should be handled differently; below are practical steps and small automation examples you can apply right away.

For expired / permanently discontinued items

  • Immediately stop sales, quarantine the physical stock, document disposal or recall steps and record batch/lot numbers for compliance.
  • Update inventory feeds and marketplaces so third‑party channels don't keep selling the item.
  • Decide how the product page should behave: use an explicit "Discontinued/No longer available" page with alternatives (keeps backlinks and helps users), or return a permanent gone status only when you will never relist and the page has no valuable inbound links. If you want to send a 410 for permanently removed SKUs, do so deliberately.
  • Keep audit logs so you can prove removal/disposal if needed.

Example: send a 410 from the app when a SKU is permanently removed

http_response_code(410);
echo "This item has been discontinued. See similar products below.";

For out‑of‑stock but restockable items

  • Show expected restock date or allow pre‑orders/backorders when appropriate. Be clear about delivery timing and payment policy.
  • Offer "notify me" by email/SMS and measure conversion from notifications to purchases.
  • Surface close substitutes on the page and in cart upsell paths to capture demand instead of losing it.
  • For near‑expiry items that must clear, use timed discounts, bundles, or local pickup only.

Simple automation pseudo‑logic

if (product.expiry_date && product.expiry_date < today) {
  product.status = "expired";
  disablePurchase(product);
  notifyOperations(product.sku);
}

Operational tips

  • Run a daily expiry check, sync inventories to all channels, and track metrics: stockout rate, notification->purchase conversion, and lost sales by SKU. If search engines or customers report problems after you remove pages, restore a user‑friendly 200 page with alternatives while you investigate.

Recommended Answers

All 2 Replies

Personally, we use the 410 Gone HTTP status. It's like a 404 error message, but instead of telling the browser / search engine that the page requested simply doesn't exist, you're saying that you know what page they were talking about, but it no longer exists, and so don't ever request it again.

I would couple the 410 Gone HTTP status with a friendly message on the site that links to related products to check out instead.

Just to clarify, that's how I would deal with expired products, but for out-of-stock products, I would simply offer an option to be notified when they're in stock again.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.