V
V
Valery Vitalievich2020-02-26 17:41:31
opencart
Valery Vitalievich, 2020-02-26 17:41:31

How to hide products in opencart?

Tell me how to hide products in ocStore 2.1.0.2.1 with a remainder of -100 (do not delete them) without reference to the status, just hide products with a remainder of -100)
I found such a solution, but it does not work for me

In the file catalog/model/ catalog/product.php

About line 78, find:

$sql .= " LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) LEFT JOIN " . DB_PREFIX . "product_to_store p2s ON (p.product_id = p2s.product_id) WHERE pd.language_id = '" . (int)$this->config->get('config_language_id') . "' AND p.status = '1' AND p.date_available <= NOW() AND p2s.store_id = '" . (int)$this->config->get('config_store_id') . "'";
Replaced by

$sql .= " LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) LEFT JOIN " . DB_PREFIX . "product_to_store p2s ON (p.product_id = p2s.product_id) WHERE pd.language_id = '" . (int)$this->config->get('config_language_id') . "' AND p.status = '1' AND p.quantity > 0 AND p.date_available <= NOW() AND p2s.store_id = '" . (int)$this->config->get('config_store_id') . "'";

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
liza2019, 2020-02-29
@valera_91

replace AND p.quantity > 0
with
AND p.quantity > '-100'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question