Post by Qphoria » Wed Aug 04, 2010 2:19 am

namasy wrote:plz i need hide some links from the list of information v1.4.8b

how?
have you tried reading the entire thread:
http://forum.opencart.com/viewtopic.php ... ead#p31816

OpenCart 2.0.x Mod Update Info

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by DannyMacD » Wed Aug 25, 2010 7:22 pm

Qphoria wrote:1. EDIT: catalog/model/catalog/information.php
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");
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() . "' AND i.sort_order <> '-1' ORDER BY i.sort_order ASC");
Then set the sort to -1 to hide it from the sidebox.

Hi Q,

i cant seem to find this code? im on 1.4.8b the only code i have in that file is:

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.status = '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.status = '1' ORDER BY i.sort_order, LCASE(id.title) ASC");
		
		return $query->rows;
	}
}
?>
any ideas??

thanks :)

Active Member

Posts

Joined
Fri Jun 26, 2009 6:39 am

Post by Qphoria » Wed Aug 25, 2010 11:20 pm

it's already done in 1.4.8b

OpenCart 2.0.x Mod Update Info

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by DannyMacD » Thu Aug 26, 2010 7:14 am

Qphoria wrote:it's already done in 1.4.8b
it doesnt seem to be working.. i use -1 on the information sort order yet it still shows on the main site..

Active Member

Posts

Joined
Fri Jun 26, 2009 6:39 am

Post by Qphoria » Thu Aug 26, 2010 9:09 am

oh.. well its in 1.4.9 then

OpenCart 2.0.x Mod Update Info

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by DannyMacD » Thu Aug 26, 2010 5:20 pm

That's cool. But is there a way to get it to work on 1.4.8? I've done so much work on this store it might be a nightmare to upgrade it haha.

Active Member

Posts

Joined
Fri Jun 26, 2009 6:39 am

Post by alex1 » Sun Dec 05, 2010 5:13 pm

This works great for categories, thanks for this in 1.4.9.2.

I tried this with products, but I can't hide the product. Any trick for this?

Thanks

Active Member

Posts

Joined
Sat Oct 16, 2010 9:49 am

Post by mnichols0205 » Wed Mar 23, 2011 2:06 am

I know this is a pretty old thread but im having this problem in 1.9.1 and people are saying it is already been added by default and it is not working on my cart.

Here is what i see

<?php
class ModelCatalogCategory extends Model {
public function getCategory($category_id) {
$query = $this->db->query("SELECT DISTINCT * 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.category_id = '" . (int)$category_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'");

return $query->row;
}

public function getCategories($parent_id = 0) {

$category_data = $this->cache->get('category.' . $parent_id . '.' . $this->config->get('config_language_id') . '.' . (int)$this->config->get('config_store_id'));

if (!$category_data) {
$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' AND c.sort_order <> '-1' ORDER BY c.sort_order, LCASE(cd.name)");

$category_data = $query->rows;

$this->cache->set('category.' . $parent_id . '.' . $this->config->get('config_language_id') . '.' . (int)$this->config->get('config_store_id'), $category_data);
}

return $category_data;
}

public function getTotalCategoriesByCategoryId($parent_id = 0) {
$query = $this->db->query("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "category c LEFT JOIN " . DB_PREFIX . "category_to_store c2s ON (c.category_id = c2s.category_id) WHERE c.parent_id = '" . (int)$parent_id . "' AND c2s.store_id = '" . (int)$this->config->get('config_store_id') . "' AND c.status = '1' AND c.sort_order <> '-1'");

return $query->row['total'];
}
}
?>

Can someone please help

Newbie

Posts

Joined
Thu Jan 06, 2011 9:45 am

Post by Qphoria » Wed Mar 23, 2011 3:35 am

Looks right to me.. I see the code:

c.sort_order <> '-1'

OpenCart 2.0.x Mod Update Info

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by kaylamatthews » Wed Aug 24, 2011 11:54 am

Qphoria wrote:just add

Code: Select all

 AND c.sort_order <> '-1'
right before

Code: Select all

ORDER BY
and set the sort_order to -1 to hide from the side
Doing this in 1.5.0 seems to hide the category from both the category module in the side column AND in the top menu, is there a way to only exclude categories in the side category module but not in the top menu?

Kayla

New member

Posts

Joined
Wed Jun 01, 2011 12:30 pm

Post by kaylamatthews » Wed Aug 24, 2011 1:27 pm

kaylamatthews wrote:
Qphoria wrote:just add

Code: Select all

 AND c.sort_order <> '-1'
right before

Code: Select all

ORDER BY
and set the sort_order to -1 to hide from the side
Doing this in 1.5.0 seems to hide the category from both the category module in the side column AND in the top menu, is there a way to only exclude categories in the side category module but not in the top menu?

Kayla
I found the solution here - thanks uksitebuilder! :)

http://forum.opencart.com/viewtopic.php ... 39#p186821

New member

Posts

Joined
Wed Jun 01, 2011 12:30 pm

Post by jg_hill » Thu Feb 09, 2012 11:03 pm

Anybody have this working in 1.5.1.3? I need to be able to exclude several top categories from showing in the side category module....thanks!

James Hill
http://www.cypressparacord.com


Newbie

Posts

Joined
Tue Aug 09, 2011 1:28 am

Post by Qphoria » Fri Feb 10, 2012 12:30 am

namasy wrote:plz i need hide some links from the list of information v1.4.8b

how?
By reading this thread and making the change.

OpenCart 2.0.x Mod Update Info

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by aminorart » Thu Nov 15, 2012 2:45 pm

This worked for me, I am using 1.5.4.1
http://opencart.web2y.net/69271--solved ... nu-sidebar

Newbie

Posts

Joined
Wed Sep 19, 2012 6:18 am

Post by adida » Thu Jan 24, 2013 5:00 pm

Hello,

My question is can the above methods exclude top category and leave its subcategories in the left menu?

The reason I am asking is that I want to create one parent category Catalog - and include many sub and sub-sub categories into it. I want Catalog to be displayed on the horizontal menu, and its subcategories in a sidebar menu. Is there any good commercial plugin or hard-coding trick to solve this issue? ???

Newbie

Posts

Joined
Mon Jul 23, 2012 1:22 pm

Post by bountico » Fri Jun 06, 2014 2:42 am

Qphoria wrote:Very easy:

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;
}
3. REPLACE WITH:

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;
}
Now just set the sort order to -1 for all the ones you don't want to show.
This does remove the category from the sidebar, but it seems to remove it from the Site Map as well. Is there a way to keep it in the Site Map? Version 1.5.5.1

Thank you for your assistance!

Newbie

Posts

Joined
Thu Jun 20, 2013 5:32 am

Post by Qphoria » Tue Jun 10, 2014 9:01 pm

bountico wrote: This does remove the category from the sidebar, but it seems to remove it from the Site Map as well. Is there a way to keep it in the Site Map? Version 1.5.5.1

Thank you for your assistance!
Ok... undo the change to the model file... and instead we can add the check to the category module itself so that ONLY the category module hides this.

1. EDIT: catalog/controller/module/category.php

2. FIND:

Code: Select all

foreach ($categories as $category) {
3. AFTER, ADD:

Code: Select all

if ($category['sort_order'] == -1) { continue; }

Alternatively, you could use my Split categories module that lets you choose which categories show in which module and have multiple category modules. Just disable the normal category module. I also have one for Split Information links to allow you to have different information pages in different modules

OpenCart 2.0.x Mod Update Info

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by theace » Tue Jun 17, 2014 4:44 pm

Hey Q,

Here's what I want to do - let me know if there's a better way as compared to the solution I came up with.

I want to offer certain products to customers ONLY via coupons (they are not available for normal sale). I've bought your plugin that will allow me to assign the product to a coupon code.

Now, since I don't want these products to be on sale normally, I figured that they should not be displayed on the store front at all and so, I want to hide them from everywhere (even the search box and "latest" section if possible) while keeping them "active" somehow so that the coupon code can still add them to the cart.

Hence, I'm thinking of using this mod to hide the products. Is there any way to adapt this mod for certain products on 1.5.5.1? Is the idea of using this particular mod the best solution for this problem? I cannot afford purchasing another plugin for now since I've already bought 2 this month so a free solution would be nice :)

New member

Posts

Joined
Sun Jun 17, 2012 2:17 am

Post by prolitekeiran » Tue Apr 14, 2015 5:14 pm

Thanks to Qphoria. I know this is old, but it helped me nonetheless.

I used this to add a category of products for manual entry of outdated items that our back end staff can use to generate orders in the system as they come up rather than waste a huge swath of database space and time for products that have been out of date for nearly a decade... And yes, we still have product in use that's more than a decade old and we still try to support them... it does happen. :)

Newbie

Posts

Joined
Wed Nov 12, 2014 4:15 pm

Post by IP_CAM » Fri Sep 01, 2017 12:43 pm

Well, but this Posting is new, and about a simple Adaption for OC v.1.5.6.4 / 1.5.6.5 Versions :D
Ernie
viewtopic.php?f=20&t=109704&p=684001#p684001

Ernie's OpenShop v.1.75 + OpenCart v.1.5.6.5 LIGHT Test Sites with free responsive Themes
http://www.bigmax.ch/shop/ - http://www.ebikes.li - http://www.ipc.li/shop/ - http://www.openshop.li/shop/
Image


User avatar
Guru Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland
Who is online

Users browsing this forum: No registered users and 14 guests