Zen Cart Logo
Forums / Setting Up Categories, Products, Attributes / Setting an attribute to be 'Required' does not work.

Setting an attribute to be 'Required' does not work.

Views: 3,167

Results 21 to 37 of 37
4 Mar 2014, 2:17 AM
#21
mike_d_1 avatar

mike_d_1

New Zenner

Join Date:
Sep 2013
Location:
Honolulu, HI
Posts:
88
Plugin Contributions:
0

Setting an attribute to be 'Required' does not work.

Thanks for the advice on the drop-downs. I'll be implementing that everywhere.

Ajeh:

Are you using any addons for Attributes?

I'm using Flexible Attrbibutes.

I was using Dynamic Price Updater for a little bit but turned it off and haven't used it since.

4 Mar 2014, 2:33 AM
#22
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Setting an attribute to be 'Required' does not work.

Is there an On/off switch on this Flexible Attributes that you are using to see if your attributes work as they should by default without it? More or less I am looking for a way to test if there is something on your settings or template causing this or if this addon is causing problems and if you need to look into a solution for this addon ...

4 Mar 2014, 2:44 AM
#23
mike_d_1 avatar

mike_d_1

New Zenner

Join Date:
Sep 2013
Location:
Honolulu, HI
Posts:
88
Plugin Contributions:
0

Re: Setting an attribute to be 'Required' does not work.

Ajeh:

Is there an On/off switch on this Flexible Attributes that you are using to see if your attributes work as they should by default without it? More or less I am looking for a way to test if there is something on your settings or template causing this or if this addon is causing problems and if you need to look into a solution for this addon ...

A way to just turn off Flexible Attributes doesn't jump out at me. It was one of the first add-ons I installed and I remember the required attributes working the way they should after I installed it but I did change a few settings...I'll look through the readme, see how to turn it off.

4 Mar 2014, 3:05 AM
#24
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Setting an attribute to be 'Required' does not work.

Could you go to phpMyAdmin and in your table:
configuration

do a search for the configuration_key
TEXT_PREFIX

What is the:
configuration_value

on that?

4 Mar 2014, 3:52 AM
#25
mike_d_1 avatar

mike_d_1

New Zenner

Join Date:
Sep 2013
Location:
Honolulu, HI
Posts:
88
Plugin Contributions:
0

Re: Setting an attribute to be 'Required' does not work.

Ajeh:

Could you go to phpMyAdmin and in your table:
configuration

do a search for the configuration_key
TEXT_PREFIX

What is the:
configuration_value

on that?

I don't appear to have a TEXT_PREFIX in that table.

4 Mar 2014, 3:56 AM
#26
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Setting an attribute to be 'Required' does not work.

You should ... check one more time for:

SELECT * FROM configuration WHERE configuration_key LIKE 'TEXT_PREFIX';
4 Mar 2014, 3:58 AM
#27
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Setting an attribute to be 'Required' does not work.

NOTE: If you still cannot find it, run this in the SQL:

INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Text prefix', 'TEXT_PREFIX', 'txt_', 'Prefix used to differentiate between text option values and other option values', 0, NULL, now(), now(), NULL, NULL);

and then see if things start working ...

4 Mar 2014, 4:03 AM
#28
mike_d_1 avatar

mike_d_1

New Zenner

Join Date:
Sep 2013
Location:
Honolulu, HI
Posts:
88
Plugin Contributions:
0

Re: Setting an attribute to be 'Required' does not work.

Ajeh:

You should ... check one more time for:

SELECT * FROM configuration WHERE configuration_key LIKE 'TEXT_PREFIX';


I've attached a screen capture of the result in case I'm not doing this correctly, but it seems like I don't have a TEXT_PREFIX?

Attachment 13856
4 Mar 2014, 4:05 AM
#29
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Setting an attribute to be 'Required' does not work.

You win not there ... go ahead and add it and see what happens ... :lookaroun

4 Mar 2014, 4:34 AM
#30
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Setting an attribute to be 'Required' does not work.

Also, check for these settings ...
Search for the configuration_key
PRODUCTS_OPTIONS_TYPE_SELECT
UPLOAD_PREFIX

If those are missing, you can fix them with:

INSERT INTO `configuration` VALUES ('', 'Product option type Select', 'PRODUCTS_OPTIONS_TYPE_SELECT', '0', 'The number representing the Select type of product option.', 0, NULL, '2007-03-19 17:57:39', '2007-03-19 17:57:39', NULL, NULL);

INSERT INTO `configuration` VALUES ('', 'Upload prefix', 'UPLOAD_PREFIX', 'upload_', 'Prefix used to differentiate between upload options and other options', 0, NULL, '2007-03-19 17:57:39', '2007-03-19 17:57:39', NULL, NULL);

What version of Zen Cart are you using?

4 Mar 2014, 5:13 AM
#31
mike_d_1 avatar

mike_d_1

New Zenner

Join Date:
Sep 2013
Location:
Honolulu, HI
Posts:
88
Plugin Contributions:
0

Re: Setting an attribute to be 'Required' does not work.

Ajeh:

NOTE: If you still cannot find it, run this in the SQL:

INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Text prefix', 'TEXT_PREFIX', 'txt_', 'Prefix used to differentiate between text option values and other option values', 0, NULL, now(), now(), NULL, NULL);


Made this first change and things appear to be working again (thanks!)

> **Ajeh:**
>
> Also, check for these settings ...
> Search for the configuration_key
> PRODUCTS_OPTIONS_TYPE_SELECT
> UPLOAD_PREFIX
> 
> If those are missing, you can fix them with:
> ```
INSERT INTO `configuration` VALUES ('', 'Product option type Select', 'PRODUCTS_OPTIONS_TYPE_SELECT', '0', 'The number representing the Select type of product option.', 0, NULL, '2007-03-19 17:57:39', '2007-03-19 17:57:39', NULL, NULL);

INSERT INTO `configuration` VALUES ('', 'Upload prefix', 'UPLOAD_PREFIX', 'upload_', 'Prefix used to differentiate between upload options and other options', 0, NULL, '2007-03-19 17:57:39', '2007-03-19 17:57:39', NULL, NULL);

What version of Zen Cart are you using?

I'm using v1.5.1. Those configuration_keys are both missing and when I try to run the code I get an error:

Error

SQL query:

INSERT INTO configuration
VALUES (
'', 'Upload prefix', 'UPLOAD_PREFIX', 'upload_', 'Prefix used to differentiate between upload options and other options', 0, NULL , '2007-03-19 17:57:39', '2007-03-19 17:57:39', NULL , NULL
)

MySQL said: Documentation
#1136 - Column count doesn't match value count at row 1

4 Mar 2014, 1:36 PM
#32
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Setting an attribute to be 'Required' does not work.

Try this from the v1.5.1 sql file and do them one by one:

INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Upload prefix', 'UPLOAD_PREFIX', 'upload_', 'Prefix used to differentiate between upload options and other options', 0, NULL, now(), now(), NULL, NULL);

and this one:

INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Product option type Select', 'PRODUCTS_OPTIONS_TYPE_SELECT', '0', 'The number representing the Select type of product option.', 0, NULL, now(), now(), NULL, NULL);
5 Mar 2014, 11:21 PM
#33
mike_d_1 avatar

mike_d_1

New Zenner

Join Date:
Sep 2013
Location:
Honolulu, HI
Posts:
88
Plugin Contributions:
0

Re: Setting an attribute to be 'Required' does not work.

Ajeh:

Try this from the v1.5.1 sql file and do them one by one:

INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Upload prefix', 'UPLOAD_PREFIX', 'upload_', 'Prefix used to differentiate between upload options and other options', 0, NULL, now(), now(), NULL, NULL);

> 
> and this one:
> ```
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Product option type Select', 'PRODUCTS_OPTIONS_TYPE_SELECT', '0', 'The number representing the Select type of product option.', 0, NULL, now(), now(), NULL, NULL);

The fixes seem to have remedied my problems. Thanks so much, I don't think I ever would've got that on my own. I made a small donation, hopefully you can get a coffee out of it.

5 Mar 2014, 11:27 PM
#34
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Setting an attribute to be 'Required' does not work.

Thanks very much for your support it really helps the Zen Cart Team in providing the Free Support forums and writing the code for Zen Cart ... :smile:

27 Oct 2014, 8:41 PM
#35
apogeerockets avatar

apogeerockets

Zen Follower

Join Date:
Aug 2011
Posts:
104
Plugin Contributions:
0

Re: Setting an attribute to be 'Required' does not work.

Aha! I've had this same issue and adding those three configuration rows fixed it. We're also on 1.5.1. Not sure why they were missing in the first place, though....

27 Oct 2014, 8:42 PM
#36
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Setting an attribute to be 'Required' does not work.

A lot of addons are written incorrectly and delete those based on their install methods ...

28 Oct 2014, 5:40 AM
#37
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Setting an attribute to be 'Required' does not work.

By "written incorrectly", Linda is referring to the fact that many mods which alter the database delete fields with (I think) configuration_group_id = 0 while installing their own fields. DrByte and swguy have written posts about this and how mod authors should correct their practices, though a more robust fix suggested was to change the stock ZC database so that there are no "0" ids. This may be implemented in the newest versions, not sure.

In any case, Flexible Attributes does not touch the database.