Problems Saving Large Number of Attribute Option Labels in Magento

前端 未结 6 1132
悲哀的现实
悲哀的现实 2020-12-29 10:47

I\'m running into a problem in a Magento system where saving a large number of attributes either doesn\'t work at all, or only partially works. It appears to be a javascrip

6条回答
  •  庸人自扰
    2020-12-29 11:10

    [Working SOLUTION]

    Hello as Alan Storm mentioned, this ussue is related with the JS logic, that handles the validation of the option label inputs. I had this problem on a project of one of my clents and I wrote simple extension, that solves it.

    You can dowload the exntesion for here: https://github.com/Jarlssen/Jarlssen_FasterAttributeOptionEdit

    Basically the extension replaces the original option template with mine template. In my template I rewrote most of the JS in the bottom of the template and replaced the form inputs with div elements ( pseudo inputs ), so when the administrator click on the pseudo input, then its replaced with the real input. In this way we avoid validating all the inputs and we validate only edited and the new added entries. The extension works well if you add options on chunks, for example 500 entries per attribute save.

    Hope, that helps.

    Additional information: http://www.jarlssen.de/blog/2014/05/07/magento-timeout-saving-attribute-options-type-multiple-select-and-dropdown

    Quick look at the pseudo generation code:

    
    getStores() as $_store): ?>
        
        
    getData('store' . $_store->getId()) ?>
    getSortOrder() ?>
    getChecked()) : ?> getReadOnly()):?> disabled="disabled"/>
    __('Delete') ?>

提交回复
热议问题