Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/opencart/opencart
Browse files Browse the repository at this point in the history
  • Loading branch information
danielkerr committed Apr 23, 2024
2 parents 3eeeab9 + 147d34b commit 884246e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
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
Expand Up @@ -3,4 +3,4 @@
$_['text_success'] = 'Success: Your language has been changed!';

// Error
$_['error_currency'] = 'Warning: Language could not be found!';
$_['error_language'] = 'Warning: Language could not be found!';
1 change: 1 addition & 0 deletions upload/install/opencart.sql
Expand Up @@ -2041,6 +2041,7 @@ INSERT INTO `oc_setting` (`store_id`, `code`, `key`, `value`, `serialized`) VALU
(0, 'config', 'config_stock_display', '0', 0),
(0, 'config', 'config_stock_warning', '0', 0),
(0, 'config', 'config_stock_checkout', '0', 0),
(0, 'config', 'config_stock_status_id', '7', 0),
(0, 'config', 'config_affiliate_status', '1', 0),
(0, 'config', 'config_affiliate_approval', '0', 0),
(0, 'config', 'config_affiliate_auto', '0', 0),
Expand Down

0 comments on commit 884246e

Please sign in to comment.