Forums / All Other Contributions/Addons / Display Specific Categories for a logged in Customer Only

Display Specific Categories for a logged in Customer Only

Views: 1,707

Results 1 to 10 of 10
19 Sep 2011, 11:34 PM
#1
jcjxxl avatar

jcjxxl

New Zenner

Join Date:
Sep 2010
Posts:
25
Plugin Contributions:
0

Display Specific Categories for a logged in Customer Only

I hope this is the right section for this question.

I've installed the Display Specific Categories for a logged in Customer Only add-on and it worked as advertised....at least I THOUGHT it did.

I'm working on a website that has specific categories. What I've done is setup categories by company.

For example -

Company A
Company B
Company C
Company D

When a new customer registers and lists their company as one of the above it should display only the category for their company. This works with only the FIRST customer. If any new customers register and use the same company name they will not see their category because their category is not merged with the original. It actually creates a second category with the same exact spelling,etc. in the drop menu from the admin panel.

So my problem is if I have 30 employees from "COMPANY A", I will end up with 30 COMPANY A entries in category assignment dropdown box in the admin panel and only the first person to register with "COMPANY A" will be able to view the category. The rest will see nothing in the category menu.

I hope that makes sense and I hope someone can shed some light on this. Thanks in advance!

:frusty:

22 Sep 2011, 12:16 PM
#2
jcjxxl avatar

jcjxxl

New Zenner

Join Date:
Sep 2010
Posts:
25
Plugin Contributions:
0

Re: Display Specific Categories for a logged in Customer Only

No solutions? I've emailed the developer of the module but no luck :(

19 Dec 2011, 6:40 PM
#3
whisperinghill avatar

whisperinghill

New Zenner

Join Date:
Nov 2010
Posts:
12
Plugin Contributions:
0

Re: Display Specific Categories for a logged in Customer Only

Yes I came across the same problem, also was hoping that the devolper had also figured out to hide from search and all other menu structures.

If i come across and solutions I will ost here

14 Feb 2012, 5:01 PM
#4
ellivir avatar

ellivir

Zen Follower

Join Date:
Sep 2005
Posts:
444
Plugin Contributions:
0

Re: Display Specific Categories for a logged in Customer Only

Any new light on this matter?

I also tested the "Category Specific Restriction of Product Price Display" but it won't make this hiding a category for a specific customer and showing for others different categories.

I may be blond but at least I found Zen.

22 Feb 2012, 2:04 PM
#5
ellivir avatar

ellivir

Zen Follower

Join Date:
Sep 2005
Posts:
444
Plugin Contributions:
0

Re: Display Specific Categories for a logged in Customer Only

ellivir:

Any new light on this matter?

I also tested the "Category Specific Restriction of Product Price Display" but it won't make this hiding a category for a specific customer and showing for others different categories.

Trying to change all the customer_id occurrences for entry_company and also changed the database table accordingly. But still didn't get it working.
Currently the module uses the customer_id, not the company name as reference, thus many accounts from the same company won't be accepted for it. If we would change it for the field "entry_company" it should work. Only that still the saving of the option seems not functioning really in my tests here.

I may be blond but at least I found Zen.

22 Feb 2012, 4:39 PM
#6
ellivir avatar

ellivir

Zen Follower

Join Date:
Sep 2005
Posts:
444
Plugin Contributions:
0

Re: Display Specific Categories for a logged in Customer Only

Actually now was thinking that the way could be to use the Group pricing functionality of "grouping" for this:

  • making groups and then selecting those for the categories as restriction

... so, going ahead, trying to check how to change it to use that group...

I may be blond but at least I found Zen.

23 Feb 2012, 9:59 PM
#7
ellivir avatar

ellivir

Zen Follower

Join Date:
Sep 2005
Posts:
444
Plugin Contributions:
0

Re: Display Specific Categories for a logged in Customer Only

What is wrong with this "sentence"?

$sql = "select group_id, group_name from " . TABLE_CUSTOMERS, . TABLE_GROUP_PRICING;

it is causing an error for my file for this project of changing this module...
I'm assuming that I need to choose the first field from the customers table and the second from the group pricing in order to get what we need.

Lines 702-708 in categories.php based on this module:

$type_cust_array[] = array('id' => '0', 'text' => 'Everyone');
$sql = "select customers_group_pricing, group_name from " . TABLE_CUSTOMERS, . TABLE_GROUP_PRICING;
$customer_name = $db->Execute($sql);
while (!$customer_name->EOF) {
$type_cust_array[] = array('id' => $customer_name->fields['customers_group_pricing'], 'text' => $customer_name->fields['group_name']);
$customer_name->MoveNext();
}

Somebody handy may see what is the structural mistake in my code above...

I may be blond but at least I found Zen.

24 Feb 2012, 2:18 PM
#8
ellivir avatar

ellivir

Zen Follower

Join Date:
Sep 2005
Posts:
444
Plugin Contributions:
0

Re: Display Specific Categories for a logged in Customer Only

Still puzzled with many things, above as well but can I do like this with the sessions to check the user:

if ($cust_var == $_SESSION['customers_group_pricing'])
line 47 from this module's tpl_categories.php as I have modified.
I would need to check the group pricing id, so not the customer id but now I need to know if I can make such "check", command at all. Is it correct language?

I may be blond but at least I found Zen.

24 Feb 2012, 8:47 PM
#9
ellivir avatar

ellivir

Zen Follower

Join Date:
Sep 2005
Posts:
444
Plugin Contributions:
0

Re: Display Specific Categories for a logged in Customer Only

ellivir:

Still puzzled with many things, above as well but can I do like this with the sessions to check the user:

if ($cust_var == $_SESSION['customers_group_pricing'])
line 47 from this module's tpl_categories.php as I have modified.
I would need to check the group pricing id, so not the customer id but now I need to know if I can make such "check", command at all. Is it correct language?

ok, got this part like this:

$chk_group = $db->Execute("select customers_group_pricing from " . TABLE_CUSTOMERS . " where customers_id = '" . $_SESSION['customer_id'] . "'");
if ($cust_var == $chk_group->fields['customers_group_pricing'])

I may be blond but at least I found Zen.

16 Mar 2012, 1:11 AM
#10
jcjxxl avatar

jcjxxl

New Zenner

Join Date:
Sep 2010
Posts:
25
Plugin Contributions:
0

Re: Display Specific Categories for a logged in Customer Only

Haven't had a chance to try the code above. Have you successfully gotten it to work?