Skip to content

Commit

Permalink
https://github.com/opencart/opencart/pull/13888/commits/ad6c94ca68e00…
Browse files Browse the repository at this point in the history
…9b92c03903a56a79bd65fa63988
  • Loading branch information
danielkerr committed Apr 24, 2024
1 parent 909bc59 commit 1040e05
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 24 deletions.
6 changes: 3 additions & 3 deletions upload/catalog/controller/account/wishlist.php
Expand Up @@ -101,10 +101,10 @@ public function getList(): string {

if ($product_info['quantity'] <= 0) {
$stock_status_id = $product_info['stock_status_id'];
} elseif ($this->config->get('config_stock_display')) {
$stock_status_id = 0;
} else {
} elseif (!$this->config->get('config_stock_display')) {
$stock_status_id = (int)$this->config->get('stock_status_id');
} else {
$stock_status_id = 0;
}

$stock_status_info = $this->model_localisation_stock_status->getStockStatus($stock_status_id);
Expand Down
6 changes: 3 additions & 3 deletions upload/catalog/controller/product/compare.php
Expand Up @@ -100,10 +100,10 @@ public function index(): void {

if ($product_info['quantity'] <= 0) {
$stock_status_id = $product_info['stock_status_id'];
} elseif ($this->config->get('config_stock_display')) {
$stock_status_id = 0;
} else {
} elseif (!$this->config->get('config_stock_display')) {
$stock_status_id = (int)$this->config->get('stock_status_id');
} else {
$stock_status_id = 0;
}

$stock_status_info = $this->model_localisation_stock_status->getStockStatus($stock_status_id);
Expand Down
30 changes: 12 additions & 18 deletions upload/catalog/controller/product/product.php
Expand Up @@ -267,27 +267,21 @@ public function index(): ?\Opencart\System\Engine\Action {
$data['description'] = html_entity_decode($product_info['description'], ENT_QUOTES, 'UTF-8');

if ($product_info['quantity'] <= 0) {
$this->load->model('localisation/stock_status');

$stock_status_info = $this->model_localisation_stock_status->getStockStatus($product_info['stock_status_id']);

if ($stock_status_info) {
$data['stock'] = $stock_status_info['name'];
} else {
$data['stock'] = '';
}
} elseif ($this->config->get('config_stock_display')) {
$data['stock'] = $product_info['quantity'];
$stock_status_id = $product_info['stock_status_id'];
} elseif (!$this->config->get('config_stock_display')) {
$stock_status_id = $this->config->get('config_stock_status_id');
} else {
$this->load->model('localisation/stock_status');
$stock_status_id = 0;
}

$stock_status_info = $this->model_localisation_stock_status->getStockStatus($this->config->get('config_stock_status_id'));
$this->load->model('localisation/stock_status');

if ($stock_status_info) {
$data['stock'] = $stock_status_info['name'];
} else {
$data['stock'] = '';
}
$stock_status_info = $this->model_localisation_stock_status->getStockStatus($stock_status_id);

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

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

0 comments on commit 1040e05

Please sign in to comment.