Sold-out Statuses

Sold-out statuses holds rules for products that are out of stock (quantity 0).

They can be used to deny purchase of a sold out product or display a custom note i.e. delayed delivery time.

Not to be confused with Delivery Statuses where a sold out status is display instead of a delivery status when a product is sold out.

Entity Object

$sold_out_status = new ent_sold_out_status();
$sold_out_status->data['name']['en'] = 'Sold Out;
$sold_out_status->save();

Reference Model

Sold-out statuses doesn't have a reference object. Instead, values from the entity will be returned.

echo reference::soldout_status($status_id)->name[$language_code];

Database Query

$sold_out_status = database::query(
  "select ss.id, ssi.name from ". DB_TABLE_PREFIX ."sold_out_statuses ss
  left join ". DB_TABLE_PREFIX ."sold_out_statuses_info ssi on (ssi.sold_out_status_id = ss.id and ssi.language_code = 'en')
  where ss.id = ". (int)$sold_out_status_id ."
  limit 1;"
)->fetch();

Revisions

Recently Edited Articles
This website uses no cookies and no third party tracking technology. We think we can do better than others and really think about your privacy.