Skip to content

Commit

Permalink
Merge pull request #13868 from pemaier/pemaier-patch-6-8
Browse files Browse the repository at this point in the history
Update product.php - Stock status
  • Loading branch information
danielkerr committed Apr 23, 2024
2 parents ec1bcda + 990187a commit 0b6939f
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 0b6939f

Please sign in to comment.