Skip to content

Commit

Permalink
Update product.php - Stock status
Browse files Browse the repository at this point in the history
  • Loading branch information
pemaier committed Apr 21, 2024
1 parent 68f8948 commit 990187a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion upload/catalog/controller/product/product.php
Expand Up @@ -279,7 +279,15 @@ public function index(): ?\Opencart\System\Engine\Action {
} elseif ($this->config->get('config_stock_display')) {
$data['stock'] = $product_info['quantity'];
} else {
$data['stock'] = $this->language->get('text_instock');
$this->load->model('localisation/stock_status');

$stock_status_info = $this->model_localisation_stock_status->getStockStatus($this->config->get('config_stock_status_id'));

if ($stock_status_info) {
$data['stock'] = $stock_status_info['name'];
} else {
$data['stock'] = '';
}
}

$data['rating'] = (int)$product_info['rating'];
Expand Down

0 comments on commit 990187a

Please sign in to comment.