Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Setting defaults for attribute values
 
Arslan
Jr. Member
 
Total Posts:  5
Joined:  2007-11-21
 

Hi everybody,

I see that it is possible to set the default option for attributes.
Say I got an attribute named “color” with options “blue” and “red”.
Next to every option I have the choice to set that option as default (in administration)
Although that setting is apparently saved in the database it has no effect on the frontend.
In the dropdown, the option that was set as default is not preselected. In source code I can see, that the JSON notation for the options does not contain the information, if default or not. So it is not implemented yet?

How should I deal with this? Is there a fix? Should I try myself? (Adjust php that generates the JSON and adjust the javascript, that is responsible for evaluating the JSON)

Thanks for your ideas,
Arslan

 
Magento Community Magento Community
Magento Community
Magento Community
 
DirectLowVoltage
Jr. Member
 
Total Posts:  30
Joined:  2009-02-19
 

Default attributes work just fine… I’m not quite sure what your trying to accomplish…

When you make a new attribute you can select a default value <if you want to> that will be entered automatically when you save a product with that attribute field blank.. or import…

Example:

You have the attribute color.. under colors you have white, blue, red, green, yellow......

under your attribute sets.. you can drag “color” into all the sets that you want to use color <I believe default come with color already in it>

When you make a product using an attribute set with “color” in it, it will show up on the create product general tab page..

If you don’t fill out a color and save the product.. it will automatically put your default value in.

I personally don’t use defaults, but I’ve tested them and they work fine.

Does this help?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Arslan
Jr. Member
 
Total Posts:  5
Joined:  2007-11-21
 

Thank you for your reply.

I want the default value to be preselected in the dropdown in frontend.
For example I set “red” as default in backend.

In frontend a dropdown is generated with options

“please choose”
“blue”
“red”
“green”

and in that dropdown, I want “red” to be preselected.
As far as I can see, the JSON, that holds all information on attributes, does not contain an information like “default: true”.
It does not seem to be implemented.

Or am I missing something?

Thanks a lot for your help.

 
Magento Community Magento Community
Magento Community
Magento Community
 
DirectLowVoltage
Jr. Member
 
Total Posts:  30
Joined:  2009-02-19
 

you can try to not use an attribute for the “color” and instead make a “product option"… of color and then fill them out in there… that way you only need to create 1 product…

if you make a configurable product. you hafta make a simple product for each item in all the colors you want to sell it in… then you link them to the configurable product.. read the thread below

http://www.magentocommerce.com/knowledge-base/entry/tutorial-creating-a-configurable-product

did that help?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Arslan
Jr. Member
 
Total Posts:  5
Joined:  2007-11-21
 

Hi again,

I might be describing my problem in a wrong way, or maybe I don’t understand the link of that article to my problem.
Sorry for that, if it is the case.

I am on the product detail page. That one, the visitor of the shop sees. There are several product attributes which are customizable by means of dropdowns. Like the color attribute. In that case there is a drop down to select different colors from.
About that drop down I am talking. I want to be able to say in the backend, which of those displayed color values should be preselected.
So that, if a visitor comes to the product detail page of a product that has the attribute color, the dropdown showing the options should have for example “red” preselected.

Any ideas?

Greets,
Arslan

 
Magento Community Magento Community
Magento Community
Magento Community
 
CreedFeed
Member
 
Total Posts:  74
Joined:  2007-08-31
Milwaukee, WI
 

I’m looking for a solution to this as well. Using configurable products, is there a way to pre-select a default configuration when the customer views the product initially?

- product A has size and color attributes and is a configurable item
- customer goes to the product view page for product A
- the dropdowns for size and color are defaulted to values (say size M and color black)

?

 
Magento Community Magento Community
Magento Community
Magento Community
 
jballotti
Guru
 
Avatar
Total Posts:  339
Joined:  2008-04-20
Chicago area
 
Arslan - 10 March 2009 07:06 AM

Hi again,

I might be describing my problem in a wrong way, or maybe I don’t understand the link of that article to my problem.
Sorry for that, if it is the case.

I am on the product detail page. That one, the visitor of the shop sees. There are several product attributes which are customizable by means of dropdowns. Like the color attribute. In that case there is a drop down to select different colors from.
About that drop down I am talking. I want to be able to say in the backend, which of those displayed color values should be preselected.
So that, if a visitor comes to the product detail page of a product that has the attribute color, the dropdown showing the options should have for example “red” preselected.

Any ideas?

Greets,
Arslan

Are you creating a configurable product or a product with custom options?

question

 
Magento Community Magento Community
Magento Community
Magento Community
 
Star7591
Jr. Member
 
Total Posts:  12
Joined:  2008-01-11
Switzerland
 

I just drop in, cause my question is the same:
using simple products with custom options, I’d like to set a default (=selected) value. e.g for radio button options
Your help is very welcomed.

 
Magento Community Magento Community
Magento Community
Magento Community
 
unfeasible
Sr. Member
 
Avatar
Total Posts:  94
Joined:  2008-03-03
New Zealand
 

Was there any answer found for this? I too am trying to have a default selection for a customiseable product option.

 
Magento Community Magento Community
Magento Community
Magento Community
 
sulekh
Member
 
Total Posts:  37
Joined:  2009-08-21
 

Am also search for a similar kind of product option. any one got the solution

 
Magento Community Magento Community
Magento Community
Magento Community
 
furnitureforyoultd
Enthusiast
 
Total Posts:  833
Joined:  2009-03-09
 

For default selection of custom options in the frontend you want this thread: http://www.magentocommerce.com/boards/viewthread/49959/

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top