1. EDIT: catalog/model/catalog/category.php
2. FIND:
Code: Select all
public function getCategories($parent_id = 0) {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "category c LEFT JOIN " . DB_PREFIX . "category_description cd ON (c.category_id = cd.category_id) WHERE c.parent_id = '" . (int)$parent_id . "' AND cd.language_id = '" . (int)$this->language->getId() . "' ORDER BY c.sort_order");
return $query->rows;
}
Code: Select all
public function getCategories($parent_id = 0) {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "category c LEFT JOIN " . DB_PREFIX . "category_description cd ON (c.category_id = cd.category_id) WHERE c.parent_id = '" . (int)$parent_id . "' AND cd.language_id = '" . (int)$this->language->getId() . "' AND c.sort_order <> '-1' ORDER BY c.sort_order");
return $query->rows;
}
2. FIND:
Code: Select all
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "information i LEFT JOIN " . DB_PREFIX . "information_description id ON (i.information_id = id.information_id) WHERE id.language_id = '" . (int)$this->language->getId() . "' ORDER BY i.sort_order ASC");
Code: Select all
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "information i LEFT JOIN " . DB_PREFIX . "information_description id ON (i.information_id = id.information_id) WHERE id.language_id = '" . (int)$this->language->getId() . "' AND i.sort_order <> '-1' ORDER BY i.sort_order ASC");
when I try this i'm getting the following error:Qphoria wrote:1. EDIT: catalog/model/catalog/information.php
2. FIND:3. REPLACE WITH:Code: Select all
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "information i LEFT JOIN " . DB_PREFIX . "information_description id ON (i.information_id = id.information_id) WHERE id.language_id = '" . (int)$this->language->getId() . "' ORDER BY i.sort_order ASC");
Then set the sort to -1 to hide it from the sidebox.Code: Select all
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "information i LEFT JOIN " . DB_PREFIX . "information_description id ON (i.information_id = id.information_id) WHERE id.language_id = '" . (int)$this->language->getId() . "' AND i.sort_order <> '-1' ORDER BY i.sort_order ASC");
Fatal error: Call to undefined method Language::getId() in C:\xampp\htdocs\catalog\model\catalog\information.php on line 10
any ideas?
Code: Select all
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "information i LEFT JOIN " . DB_PREFIX . "information_description id ON (i.information_id = id.information_id) WHERE id.language_id = '" . (int)$this->config->get('config_language_id') . "' AND i.sort_order <> '-1' ORDER BY i.sort_order ASC");
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool
If you're not living on the edge ... you're taking up too much space!
hey fido, this doesn't seem to have any effect at all. maybe it's because i'm trying to hide the sitemap, i don't think it's treated as a regular categoryfido-x wrote:The code placed here is for version 1.3.4. You're using 1.4.0, so you'll need to use the following as the replacement code:Code: Select all
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "information i LEFT JOIN " . DB_PREFIX . "information_description id ON (i.information_id = id.information_id) WHERE id.language_id = '" . (int)$this->config->get('config_language_id') . "' AND i.sort_order <> '-1' ORDER BY i.sort_order ASC");
Got rid of the error, didn't it?gartheman wrote:hey fido, this doesn't seem to have any effect at all. maybe it's because i'm trying to hide the sitemap, i don't think it's treated as a regular category
OK, you want to hide the sitemap. Maybe you should have said that in the first place, 'cos that's different. In "catalog/view/theme/YOUR_TEMPLATE/template/module/information.tpl", delete the following line (line 9 in the default):-
Code: Select all
<li><a href="<?php echo $sitemap; ?>"><?php echo $text_sitemap; ?></a></li>
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool
If you're not living on the edge ... you're taking up too much space!
actually yeah, it did fix the errorfido-x wrote:Got rid of the error, didn't it?gartheman wrote:hey fido, this doesn't seem to have any effect at all. maybe it's because i'm trying to hide the sitemap, i don't think it's treated as a regular category
OK, you want to hide the sitemap. Maybe you should have said that in the first place, 'cos that's different. In "catalog/view/theme/YOUR_TEMPLATE/template/module/information.tpl", delete the following line (line 9 in the default):-Code: Select all
<li><a href="<?php echo $sitemap; ?>"><?php echo $text_sitemap; ?></a></li>
sorry, only realised after that what I was trying to do was different to just hiding a link in information
thanks again
Code: Select all
<?php
class ModelCatalogInformation extends Model {
public function getInformation($information_id) {
$query = $this->db->query("SELECT DISTINCT * FROM " . DB_PREFIX . "information i LEFT JOIN " . DB_PREFIX . "information_description id ON (i.information_id = id.information_id) LEFT JOIN " . DB_PREFIX . "information_to_store i2s ON (i.information_id = i2s.information_id) WHERE i.information_id = '" . (int)$information_id . "' AND id.language_id = '" . (int)$this->config->get('config_language_id') . "' AND i2s.store_id = '" . (int)$this->config->get('config_store_id') . "'" AND i.sort_order <> '-1' );
return $query->row;
}
public function getInformations() {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "information i LEFT JOIN " . DB_PREFIX . "information_description id ON (i.information_id = id.information_id) LEFT JOIN " . DB_PREFIX . "information_to_store i2s ON (i.information_id = i2s.information_id) WHERE id.language_id = '" . (int)$this->config->get('config_language_id') . "' AND i2s.store_id = '" . (int)$this->config->get('config_store_id') . "' AND i.sort_order <> '-1' ORDER BY i.sort_order, id.title ASC");
return $query->rows;
}
}
?>
Any ideas what we need to do in 1.4.4 ?
K
All fixed now and I see that Q has also used the same protocol to hide categories in his CMS - perhaps this mod could be rolled into the core as a standard way of leveraging sort order to hide.
Is there an similar tweak that can be applied to category on version 1.48b? The code is a little different to that of 1.4 whereby c.status determines whether the category is functional or not. If it is not enabled it also cannot be displayed regardless of not being in the list (i.e. by typing the url)
Code: Select all
public function getCategories($parent_id = 0) {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "category c LEFT JOIN " . DB_PREFIX . "category_description cd ON (c.category_id = cd.category_id) LEFT JOIN " . DB_PREFIX . "category_to_store c2s ON (c.category_id = c2s.category_id) WHERE c.parent_id = '" . (int)$parent_id . "' AND cd.language_id = '" . (int)$this->config->get('config_language_id') . "' AND c2s.store_id = '" . (int)$this->config->get('config_store_id') . "' AND c.status = '1' ORDER BY c.sort_order, LCASE(cd.name)");
return $query->rows;
}
Thanks
Diggydog
http://www.promoteyourproducts.co.uk
Code: Select all
AND c.sort_order <> '-1'
Code: Select all
ORDER BY
Users browsing this forum: No registered users and 18 guests