Post by tboned » Mon Sep 19, 2011 5:34 am

I'd like to offer products to a select group of folks that wouldn't be visible to the public. I also dont want them to have to register or "login" to see the item, because several of the customers will be elderly.

Does 1.5.x have any way to not make a product public...in other words, customers would need the link to the specific product id to "see" the item?

Thanks all!!

Newbie

Posts

Joined
Sat Apr 03, 2010 12:42 pm

Post by SXGuy » Mon Sep 19, 2011 6:29 am

cant remember if sort order works for products, but try changing it to -1, but remember the url to the product first before you change it.

If that doesnt work, add it to a category and change that sort order to -1

Active Member

Posts

Joined
Sun Nov 08, 2009 2:07 am

Post by ronnieb » Tue Nov 29, 2011 2:45 am

Unfortunatly this doesn't work, tried hiding category and product as -1 but it put them at the top of the listing

any other solution ?

New member

Posts

Joined
Tue May 24, 2011 3:44 pm

Post by Qphoria » Tue Nov 29, 2011 2:53 am

ronnieb wrote:Unfortunatly this doesn't work, tried hiding category and product as -1 but it put them at the top of the listing

any other solution ?
yea.. this feature of mine was removed in current versions.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by ronnieb » Tue Nov 29, 2011 3:07 am

Found a solution

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.
1.5.1.3 is slightly different

I have stuck it in this code

Code: Select all

AND c2s.store_id = '" . (int)$this->config->get('config_store_id') . "'  [b]AND c.sort_order <> '-1'[/b]  AND c.status = '1' ORDER BY c.sort_order, LCASE(cd.name)");
which seems to work

http://forum.opencart.com/viewtopic.php?f=22&t=6670

New member

Posts

Joined
Tue May 24, 2011 3:44 pm
Who is online

Users browsing this forum: No registered users and 21 guests