Zen Cart Logo
Forums / General Questions / 'Display Specific Categories for a logged in Custom' creates warning error.

'Display Specific Categories for a logged in Custom' creates warning error.

Views: 902

Results 1 to 6 of 6
24 Jun 2014, 3:48 PM
#1
cozmoz avatar

cozmoz

New Zenner

Join Date:
Jun 2014
Location:
Suffolk, England
Posts:
23
Plugin Contributions:
0

'Display Specific Categories for a logged in Custom' creates warning error.

Hello,

I have installed the files included in the 'Display Specific Categories for a logged in Custom' addon but I am now receiving the following error:

"WARNING: An Error occurred, please refresh the page and try again."

The error is occurring when using the updated categories.php file to access existing categories and when going to save new categories, if anyone could help with this it would be appreciated.

I have installed the MySQL code included in the installation instructions file and made a backup of all files before starting. I have also placed an error report on the addon's page.

Many thanks,

Costa

Link to addon: https://www.zen-cart.com/downloads.php?do=file&id=1165

25 Jun 2014, 8:43 AM
#3
cozmoz avatar

cozmoz

New Zenner

Join Date:
Jun 2014
Location:
Suffolk, England
Posts:
23
Plugin Contributions:
0

Re: 'Display Specific Categories for a logged in Custom' creates warning error.

Hi Steve,

The error report is showing:

[25-Jun-2014 08:38:09 UTC] PHP Fatal error: 1146:Table 'jm_retail_test.zen_categories_customers' doesn't exist :: select customer_id
from zen_categories_customers
where categories_id = '157' in /var/www/vhosts/mydomain.co.uk/httpdocs/includes/classes/db/mysql/query_factory.php on line 120

I have run the following SQL code on install and have checked that it was placed in the right database:

CREATE TABLE IF NOT EXISTS categories_customers (categories_id int(11) NOT NULL,customer_id int(11) NOT NULL, PRIMARY KEY (categories_id,customer_id)) ENGINE=MyISAM DEFAULT CHARSET=utf8;

Hope to hear from you soon.

25 Jun 2014, 1:01 PM
#4
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,085
Plugin Contributions:
56

Re: 'Display Specific Categories for a logged in Custom' creates warning error.

When you say that you "ran the SQL code on install", how did you run that code? Did you copy & paste the code into your admin's Tools->Install SQL Patches or did you run it using the phpMyAdmin SQL tab? I'm guessing the latter, since you say that you've verified that the table is present but you're getting an error log.

Specifically, I believe that the issue is that you ran the SQL via phpMyAdmin but your Zen Cart store uses a prefix (zen_) that didn't get applied when you ran the install script (the SQL Patches tool in your admin "magically" adds the DB_PREFIX value to any table specifications). That said, use your phpMyAdmin tool to rename your categories_customers table to be zen_categories_customers.

25 Jun 2014, 3:45 PM
#5
cozmoz avatar

cozmoz

New Zenner

Join Date:
Jun 2014
Location:
Suffolk, England
Posts:
23
Plugin Contributions:
0

Re: 'Display Specific Categories for a logged in Custom' creates warning error.

Hi guy's,

I've got the plugin installed properly now by dropping the tables and adding the again through Zen Cart as suggested and adding the below line to the existing database_tables.php file.

define('TABLE_CATEGORIES_CUSTOMERS', DB_PREFIX . 'categories_customers');

Since doing this everything else on the database seems to be working but the script does not seem to be hiding the categories content from other users.

Any help would be appreciated.

Thanks!

26 Jun 2014, 12:54 PM
#6
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,085
Plugin Contributions:
56

Re: 'Display Specific Categories for a logged in Custom' creates warning error.

Cozmoz:

Hi guy's,

I've got the plugin installed properly now by dropping the tables and adding the again through Zen Cart as suggested and adding the below line to the existing database_tables.php file.

Since doing this everything else on the database seems to be working but the script does not seem to be hiding the categories content from other users.

Any help would be appreciated.

Thanks!
I suggest that you find the support thread for the plugin (usually listed in the plugin's readme file) and post your question there. People on that thread will have more experience with the plugin.