We launched another Opencart 3 free module Out Of Stock label and out of stock button, or you can take it as sold out also, these will get active when this module is installed and activated and quantity is zero. You can customize or add CSS as per your need in this module.
Installation
- Download the module "Out Of stock"
- You will get an "outofstock.ocmod.zip" zip file
- Go to Opencart admin >> Extensions >> Installer
- Upload the outofstock.ocmod.zip zip file
- Then go to admin >> Extensions >> Modifications >> Clear the cache by clicking the refresh button at the top right.
- Now to admin >> Extensions >> Extensions >> Choose Modules >> Find Out of Stock >> Then click the install button
- Then edit it and you will see admin settings for Out of Stock like below:

- Now select the Status to Enabled
- Show Label in the Product page to Yes
- Enter your required label like "Out of Stock" or "Sold Out", if your site is multi-language then enter words for all language.
- Then click Save blue button.
Now go to the front end and you can see the red label with Out of Stock ribbon if the product quantity is zero, similarly, the button becomes Out Of Stock and disabled. Like for featured products module, it will be seen as below:

For the product page, it is like below:

Modules and pages these gets activated as per the install.xml we created are the following:
Pages:
- Product Page
- Special page
- Search page
- Category page
- Manufacturer info page
Modules:
- Bestseller
- Latest
- Special
- Featured
It works 100% with the default OpenCart 3 theme but it may not work in custom theme because of the OCMOD code target. Some customization may be needed for the custom theme, but we tried to adjust code matching as much as possible.
You can study and make changes to OCMOD install.xml as per your requirement
Out of Stock
1.1
Rupak Nepali
https://webocreation.com
webocreation_module_outofstock2
config->get('module_outofstock_status')) {
$this->load->model('extension/module/outofstock');
$data['quantity'] = $this->model_extension_module_outofstock->getQuantity($product_info);
if ($data['quantity']<1){
$this->load->model('extension/module/outofstock');
$data['text_out_of_stock'] = $this->config->get('module_outofstock_label')[$this->config->get('config_language_id')];
$data['module_outofstockstyle'] = htmlspecialchars_decode($this->config->get('module_outofstock_style'));
$data['module_outofstock_show_marker_in_product_page'] = $this->config->get('module_outofstock_show_marker_in_product_page');
}
}
$data['button_cart_outOfStock'] = "Out Of Stock";
]]>
config->get('module_outofstock_status')) {
$this->load->model('extension/module/outofstock');
$data['text_out_of_stock'] = $this->config->get('module_outofstock_label')[$this->config->get('config_language_id')];
$data['module_outofstock_style'] = htmlspecialchars_decode($this->config->get('module_outofstock_style'));
}
]]>
($this->config->get('module_outofstock_status'))?$this->model_extension_module_outofstock->getQuantity($result):1,
]]>
]]>