Zen Cart Logo
Forums / Setting Up Categories, Products, Attributes / Reset attribute to "not required"

Reset attribute to "not required"

Views: 1,197

Results 1 to 7 of 7
25 Jun 2014, 2:07 AM
#1
three_sisters avatar

three_sisters

Zen Follower

Join Date:
Nov 2006
Location:
Indiana
Posts:
188
Plugin Contributions:
0

Reset attribute to "not required"

Hi - I'm updating my site from 1.3.8a to 1.5.1. I have a lot of downloadable products. One of the attributes needs a text option available though it is not required. Somehow, I have ALL of them set for "Attribute Required for Text: Yes". In 1.3.8a this hasn't posed a problem. Not sure why.

But in 1.5.1 it flags a notice in the shopping cart that text input is required. It is NEVER required, though sometimes a customer will want to add it. Is there a quick way to reset every product with attribute ID 878 to "Attribute Required for Text: No"?

Thanks a million for your help!

25 Jun 2014, 11:19 AM
#2
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Reset attribute to "not required"

Three Sisters:

Hi - I'm updating my site from 1.3.8a to 1.5.1. I have a lot of downloadable products. One of the attributes needs a text option available though it is not required. Somehow, I have ALL of them set for "Attribute Required for Text: Yes". In 1.3.8a this hasn't posed a problem. Not sure why.

But in 1.5.1 it flags a notice in the shopping cart that text input is required. It is NEVER required, though sometimes a customer will want to add it. Is there a quick way to reset every product with attribute ID 878 to "Attribute Required for Text: No"?

Thanks a million for your help!

Not sure if there is a built in ZC attribute adjustment, but one way would be through a SQL command to update all of the products that have that attribute identified. Not able to easily creat that command at the moment. Hopefully though someone can if I don't get back to it when I am able to look at the various tables and fields.

25 Jun 2014, 11:39 AM
#3
three_sisters avatar

three_sisters

Zen Follower

Join Date:
Nov 2006
Location:
Indiana
Posts:
188
Plugin Contributions:
0

Re: Reset attribute to "not required"

mc12345678:

...but one way would be through a SQL command to update all of the products that have that attribute identified. Not able to easily creat that command at the moment. Hopefully though someone can if I don't get back to it when I am able to look at the various tables and fields.

I was expecting something like that. But I, who knows NOTHING about writing SQL commands, thought it might be a fairly simple thing. :)

Thanks for the reply!

25 Jun 2014, 12:01 PM
#4
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Reset attribute to "not required"

Three Sisters:

I was expecting something like that. But I, who knows NOTHING about writing SQL commands, thought it might be a fairly simple thing. :)

Thanks for the reply!

Was able to muddle through accessing a database to identify the following. Please backup your database (which is different than your files) before running this in your store's admin panel tools, install sql patches option.

Update products_attributes set attributes_required = '0' WHERE options_values_id = '878';

Let me know of success/failure.

25 Jun 2014, 12:07 PM
#5
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Reset attribute to "not required"

mc12345678:

Was able to muddle through accessing a database to identify the following. Please backup your database (which is different than your files) before running this in your store's admin panel tools, install sql patches option.

Update products_attributes set attributes_required = '0' WHERE options_values_id = '878';

> 
> Let me know of success/failure.

Also, ofess thati forget whether the text attribute is under an option name or option value.  The above SQL assumed it to be under option value.  The command for updating the records based on option name is:

Update products_attributes set attributes_required = '0' WHERE options_id = '878';


Please further identify which of these two was correct incase someone else has a similar problem and finds this thread.
25 Jun 2014, 12:24 PM
#6
three_sisters avatar

three_sisters

Zen Follower

Join Date:
Nov 2006
Location:
Indiana
Posts:
188
Plugin Contributions:
0

Re: Reset attribute to "not required"

mc12345678:

Also, ofess thati forget whether the text attribute is under an option name or option value. The above SQL assumed it to be under option value. The command for updating the records based on option name is:

Update products_attributes set attributes_required = '0' WHERE options_id = '878';

> 
> Please further identify which of these two was correct in case someone else has a similar problem and finds this thread.

This was it...  The text attribute is an option name rather than a value.  

I confess to having to change that id...  Was totally looking at the wrong thing when I pulled that number out of the hat.  Thankfully I have NOT dealt 878 option names!

That made my day go sooo much better!  Thanks a million!
25 Jun 2014, 12:41 PM
#7
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Reset attribute to "not required"

Three Sisters:

This was it... The text attribute is an option name rather than a value. I confess to having to change that id... Was totally looking at the wrong thing when I pulled that number out of the hat. Thankfully I have NOT dealt 878 option names!That made my day go sooo much better! Thanks a million!Glad that worked out. I also got to thinking about it and it didn't make sense for me to think a text attribute would be anything other than an option name. (Option values further provide information to be associated with the option name such as when wanting to display a list of items. There is no such "list" for a text field, therefore text fields "stop" at the option name entry.)Glad I posted both though, incase someone else comes along with the same type of issue.