Zen Cart Logo
Forums / Setting Up Categories, Products, Attributes / Select Yes/No option when inserting a product

Select Yes/No option when inserting a product

Views: 629

Results 1 to 5 of 5
19 Jan 2013, 5:07 PM
#1
tluksa avatar

tluksa

New Zenner

Join Date:
Jan 2013
Posts:
2
Plugin Contributions:
0

Select Yes/No option when inserting a product

Hello,

When adding a product using the insert fuction, we get to specify options like price weight etc.
I would like to add another item, and have a yes/no dropdown or radio button... it makes no difference to me.

Is there a way to do this already thru Zen Cart or maybe a module exists or do I have to write myself?

I've already looked at the attributes stuff and although this might work, my option has to be an "administrative" option where the customer can not change the value.

Thanks for your help

Thomas

19 Jan 2013, 6:51 PM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Select Yes/No option when inserting a product

have a yes/no dropdown

my option has to be an "administrative" option where the customer can not change the value
Not sure what you are asking??

You first what a yes/no option but then state that it is not to be selectable???

20 Jan 2013, 8:10 AM
#3
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Select Yes/No option when inserting a product

tluksa:

When adding a product using the insert fuction, we get to specify options like price weight etc.
I would like to add another item, and have a yes/no dropdown or radio button... it makes no difference to me.

Is there a way to do this already thru Zen Cart or maybe a module exists or do I have to write myself?

Unless I'm misunderstanding you, you are trying to add another data field to the products information? Correct?

If so, you'll need to do some custom editing. First and foremost you'll need to add another field to the 'products' table to store the setting.
Next, you'll need to edit the following three files so that they contain suitable references to the new data entry:

/admin/includes/languages/english/product.php (this file is used when editing a product. It contains the English descriptions of the data fields)
/admin/includes/modules/update_product.php (This is the file used to update the database record)
/admin/includes/modules/product/collect_info.php (this is the file used to retrieve the product data for editing)

All of the edits are/will be very minor, and is basically a matter of copying and extending the existing data.

You'll probably find it easier to use a text field rather than trying to create a radio button or dropdown. Just enter a '0' (or blank) to indicate 'no', and a '1' to indicate a 'yes'.

What you do with this new data field after it has been added to a product is a whole new ballgame.

Cheers
Rod

20 Jan 2013, 3:29 PM
#4
tluksa avatar

tluksa

New Zenner

Join Date:
Jan 2013
Posts:
2
Plugin Contributions:
0

Re: Select Yes/No option when inserting a product

RodG:

Unless I'm misunderstanding you, you are trying to add another data field to the products information? Correct?

If so, you'll need to do some custom editing. First and foremost you'll need to add another field to the 'products' table to store the setting.
Next, you'll need to edit the following three files so that they contain suitable references to the new data entry:

/admin/includes/languages/english/product.php (this file is used when editing a product. It contains the English descriptions of the data fields)
/admin/includes/modules/update_product.php (This is the file used to update the database record)
/admin/includes/modules/product/collect_info.php (this is the file used to retrieve the product data for editing)

All of the edits are/will be very minor, and is basically a matter of copying and extending the existing data.

You'll probably find it easier to use a text field rather than trying to create a radio button or dropdown. Just enter a '0' (or blank) to indicate 'no', and a '1' to indicate a 'yes'.

What you do with this new data field after it has been added to a product is a whole new ballgame.

Cheers
Rod

You're spot on. Looks like i'm going to have to do some custom editing.

Basicaly, we're trying to tag certain products and display them based on user access so we'll have to update the user fields too... but I just wanted to make sure i'm not trying to re-invent the wheel here if someone already had a plug in available.

Thanks!
Thomas

20 Jan 2013, 4:03 PM
#5
ajeh avatar

ajeh

Oba-san

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

Re: Select Yes/No option when inserting a product

To make it a little easier ... follow the pattern of a field like:
product_is_free

to see how/where you need to make the changes for your new field ...