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

Adding Cost field to Quick simple product creation? 
 
seanjacob
Member
 
Avatar
Total Posts:  69
Joined:  2010-04-15
England
 

Does anyone know how to do this? I want to be able to use the Quick simple product creation tool for configurable products but it does not contain the all important cost field so I am having to manually go into my hundreds of products adding the cost price or exporting my products then inserting the costs and then re-uploading.

My Cost attribute is only for Simple products so it will not show up when making my configurable product as normal. So I thought maybe if I make it an required field it will appear in the Quick simple product creation table? But instead for some reason it messes up all my configurable products when I go in them, does this do the same for anyone else?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Paul-xib
Sr. Member
 
Avatar
Total Posts:  116
Joined:  2009-02-02
The Netherlands
 

Did you find a solution for this? i am trying to make the same smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
seanjacob
Member
 
Avatar
Total Posts:  69
Joined:  2010-04-15
England
 

Sorry dude I don’t think I did, I have stopped using magento now.

I manage to find a really good wordpress eCommerce plugin - http://jigoshop.com/

 
Magento Community Magento Community
Magento Community
Magento Community
 
medstore2323
Jr. Member
 
Total Posts:  1
Joined:  2011-04-25
 

Just Change the required value to Yes in the Attribute.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Joop Mulder
Jr. Member
 
Total Posts:  9
Joined:  2011-10-29
 

I would like to add the short descripiton area as well.
Any idea’s?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Silwing
Jr. Member
 
Total Posts:  6
Joined:  2010-10-01
 

I have looked into this as well… If the attribute is not used for configurable product it is sufficient to set the attribute as “Required”, it will then show up in the form.
However if the attribute is indeed used for the configurable product then it’s a lot worse.

The form is generated in the Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Config_Simple class (in app/code/core/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Simple.php) in the function _prepareForm().
The function has a local variable $attributesConfig which has an array of additional attributes to add, we need to add the attribute we want in the form to this array. But there is only two ways to change that array. Overriding the class in the local/Mage folder or add an extension with a class overriding that copies the _prepareForm method and changes the array. As almost all of the logic of the file is in _prepareForm() either way is equally bad.

I do not think there is a simple way to just change the array without also copying all the other functionality.
Maybe that should be suggested for a future update of Magento. They should simply add a protected field for the attributesConfig which can then be overrided in a child class.

EDIT: I found a better way! It is possible to simply get the fieldset of the form and add fields to that with:
$form = $this->getForm();
$fieldset = $form->getElement(’simple_product’);

then adding fields to that fieldset.

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