Adding existing attribute to all attribute sets

前端 未结 6 1782
孤街浪徒
孤街浪徒 2021-02-06 05:53

I have an existing attribute for an embed code. I need to associate this attribute with 120+ existing attribute sets.

If I know the attribute set id, ho

6条回答
  •  忘了有多久
    2021-02-06 06:50

    for people having problems with the code above,

    like: Call to a member function getModelInstance() on a non-object

    you need to add the following to to top of your file:

    include 'app/Mage.php';
    Mage::app();
    

    edit:

    im using magento 1.8.1.0 and the code still didn't work

    i had to add the following line to $newItem, this way the validation passes

        ->setAttributeCode($attCode)
    

提交回复
热议问题