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

System Attributes & Fascism
 
Gothfunc
Jr. Member
 
Total Posts:  3
Joined:  2008-05-16
 

I’m customising the Magento frontend and backend for a client.  It’s important that the interface is concise, and elements like “custom design” for the add product page should not be shown.  It seems awfully fascist to FORCE ME to present the client with options that aren’t relevant, so I don’t really understand why Magento does it.  Is there a way around it?

At the moment I’m looking through the Magento files to see if it’s possible to hack it so that system attributes can be turned into a hidden input tag with a predetermined value, but it’s a bit of a maze trying to find the right place to implement the code.  Anyone got any ideas?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Joachim
Sr. Member
 
Avatar
Total Posts:  133
Joined:  2008-01-23
Netherlands
 

Css {display:none} can do a lot. I add a new CSS file to the backend, e.g. hide.css, and included everything I don’t want to show up. So with changing one line I can turn on and off the complete customized backend.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Gothfunc
Jr. Member
 
Total Posts:  3
Joined:  2008-05-16
 

But how do I assign styles to one attribute and not others, and since some system attributes require a value, how do I give it a predefined value only when hidden?  The markup for attributes seems to be generated on the fly, so which bit of code does that?  Can we change it to allow us to hide system attributes in certain attribute sets?

Is there perhaps another way?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Gothfunc
Jr. Member
 
Total Posts:  3
Joined:  2008-05-16
 

Is there no way of doing this?  The interface is very important for this project, and I’m going to have to dump Magento if it can’t be done.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

@Gothfunc: you could play with flags in eav_attribute table. Find entity_type_id in eav_entity_type table.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Grégoire Paris
Jr. Member
 
Total Posts:  15
Joined:  2009-04-09
 

Here is a sample code for hiding attributes (yes, it is Prototype, but I think it is the simplest and cleanest way to do this).
I understand that there could be system attributes, because it must be difficult to code, but I think there really should be an XML file enabling hiding and auto-filling inputs

/**
 * @file hide.js
 * @desc hides various attributes in product edit page
 */

document.observe("dom:loaded",
    function()
    
{
        
var js_array         = new Array( "news_from_date""news_to_date""gift_message_available""content_type""enable_googlecheckout" );
        var 
hide_grandfather $Ajs_array );
        
hide_grandfather.each(
            function(
item){
                
var toHide = $(item);
                
toHide.up(1).hide();
            
}
        
)
        $(
"product_info_tabs_inventory").up().hide();//hide "Inventaire tab"
    
}
        
);
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top