Need to create a new attribute in a new type of productcreate new product attribute returns fault code 104...

How to have a sharp product image?

Is there any official lore on the Far Realm?

Can an Area of Effect spell cast outside a Prismatic Wall extend inside it?

If a planet has 3 moons, is it possible to have triple Full/New Moons at once?

Mistake in years of experience in resume?

How to fry ground beef so it is well-browned

"The cow" OR "a cow" OR "cows" in this context

Map of water taps to fill bottles

Can SQL Server create collisions in system generated constraint names?

Can someone publish a story that happened to you?

What's the name of these pliers?

Elements other than carbon that can form many different compounds by bonding to themselves?

I preordered a game on my Xbox while on the home screen of my friend's account. Which of us owns the game?

A strange hotel

Aliens crash on Earth and go into stasis to wait for technology to fix their ship

How to write a column outside the braces in a matrix?

Why does Mind Blank stop the Feeblemind spell?

"You've called the wrong number" or "You called the wrong number"

What happened to Captain America in Endgame?

Pre-plastic human skin alternative

Was there a Viking Exchange as well as a Columbian one?

Why must Chinese maps be obfuscated?

What is the most expensive material in the world that could be used to create Pun-Pun's lute?

A Paper Record is What I Hamper



Need to create a new attribute in a new type of product


create new product attribute returns fault code 104 (Incorrect attribute type)Product page tabs disappeared in admin after trying to add a new product attributeFatal error: Undefined class constant 'ENTITY'Create custom “Catalog Input Type for Store Owner” for magento 2Custom module table not found, the install is not executedMagento 2 - Create product attribute programmaticallyHow to create new product attribute with file type?Magento 2 How to remove price filter from category if module is enable?Magento 2 Create new “Catalog Input Type for Store Owner” AttributeMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







3















I am creating a module to insert a new attribute and a new type of product in my store. As template, I use the same registration screen of the Virtual Product type and include new options ONLY this type of product.
For this, in my config.xml, I used:



<catalog>
<product>
<type>
<incomm_virtual translate="label" module="incomm">
<label>Incomm Virtual</label>
<model>incomm/product_type</model>
<price_model>incomm/product_price</price_model>
<is_qty>1</is_qty>
<composite>0</composite>
<can_use_qty_decimals>0</can_use_qty_decimals>
</incomm_virtual>
</type>
</product>
</catalog>


and to configure the installation with the sql in same config.xml:



    <resources>
<abc_incommproduct_setup>
<setup>
<module>ABC_Incomm</module>
<class>Mage_Catalog_Model_Resource_Setup</class>
</setup>
</abc_incommproduct_setup>
</resources>


The next file was used mymodule / model / product / type.php containing:



class ABC_Incomm_Model_Product_Type
extends Mage_Catalog_Model_Product_Type_Virtual
{
const TYPE_INCOMM = 'incomm';
const XML_PATH_AUTHENTICATION = 'catalog/incomm/authentication';

protected function _prepareProduct(Varien_Object $buyRequest, $product, $processMode)
{
if ($this->_isStrictProcessMode($processMode)) {
return Mage::helper('ABC_Incomm_Helper_Data')->__(
'Incomm product %s cannot be added to cart. ' .
' On the product detail page click the "Go to parent site"'.
' button to access the product.',
$product->getName()
);
}
return parent::_prepareProduct($buyRequest, $product, $processMode);
}
}


In the same folder, the virtual.php:



class ABC_Incomm_Model_Product_Virtual extends Mage_Catalog_Model_Product_Type_Virtual {   
}


Finally, the SQL installation file in sql folder / abc_incommproduct_setup / mysql-install-4-0.1.0.php:



$this->startSetup();

$this->addAttribute(Mage_Catalog_Model_Product::ENTITY, 'terms_of_use', array(
'group' => 'General',
'input' => 'textarea',
'type' => 'text',
'sort_order' => 4,
'label' => 'Terms of use',
'backend' => '',
'visible' => true,
'required' => true,
'wysiwyg_enabled' => true,
'visible_on_front' => true,
'apply_to' => 'incomm', //only in this type of product
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
));

$this->endSetup();


My problem is this, after disabling the cache in magento, clear the cache and include a new type of product, in the Product Types list appears my NEW type of product, but the options NOT load the new attribute inserted via SQL. Did sqlinstall.php not run?










share|improve this question
















bumped to the homepage by Community 15 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • Is there abc_incommproduct_setup in core_resource? If so, does it have the version you specified in config.xml? What happens if you remove that record from core_resource, clear the cache, clear the sessions and give it another go?

    – Henry's Cat
    May 14 '15 at 13:23











  • Did you update the config.xml file version in the module where the SQL upgrade file is located?

    – eetzen
    May 14 '15 at 17:16











  • is not core_resource because i have used a model in my folder /model , dont work ... and yes, my config.xml have same version of the sql upgrade,

    – Matheus Silva Itep
    May 14 '15 at 23:24


















3















I am creating a module to insert a new attribute and a new type of product in my store. As template, I use the same registration screen of the Virtual Product type and include new options ONLY this type of product.
For this, in my config.xml, I used:



<catalog>
<product>
<type>
<incomm_virtual translate="label" module="incomm">
<label>Incomm Virtual</label>
<model>incomm/product_type</model>
<price_model>incomm/product_price</price_model>
<is_qty>1</is_qty>
<composite>0</composite>
<can_use_qty_decimals>0</can_use_qty_decimals>
</incomm_virtual>
</type>
</product>
</catalog>


and to configure the installation with the sql in same config.xml:



    <resources>
<abc_incommproduct_setup>
<setup>
<module>ABC_Incomm</module>
<class>Mage_Catalog_Model_Resource_Setup</class>
</setup>
</abc_incommproduct_setup>
</resources>


The next file was used mymodule / model / product / type.php containing:



class ABC_Incomm_Model_Product_Type
extends Mage_Catalog_Model_Product_Type_Virtual
{
const TYPE_INCOMM = 'incomm';
const XML_PATH_AUTHENTICATION = 'catalog/incomm/authentication';

protected function _prepareProduct(Varien_Object $buyRequest, $product, $processMode)
{
if ($this->_isStrictProcessMode($processMode)) {
return Mage::helper('ABC_Incomm_Helper_Data')->__(
'Incomm product %s cannot be added to cart. ' .
' On the product detail page click the "Go to parent site"'.
' button to access the product.',
$product->getName()
);
}
return parent::_prepareProduct($buyRequest, $product, $processMode);
}
}


In the same folder, the virtual.php:



class ABC_Incomm_Model_Product_Virtual extends Mage_Catalog_Model_Product_Type_Virtual {   
}


Finally, the SQL installation file in sql folder / abc_incommproduct_setup / mysql-install-4-0.1.0.php:



$this->startSetup();

$this->addAttribute(Mage_Catalog_Model_Product::ENTITY, 'terms_of_use', array(
'group' => 'General',
'input' => 'textarea',
'type' => 'text',
'sort_order' => 4,
'label' => 'Terms of use',
'backend' => '',
'visible' => true,
'required' => true,
'wysiwyg_enabled' => true,
'visible_on_front' => true,
'apply_to' => 'incomm', //only in this type of product
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
));

$this->endSetup();


My problem is this, after disabling the cache in magento, clear the cache and include a new type of product, in the Product Types list appears my NEW type of product, but the options NOT load the new attribute inserted via SQL. Did sqlinstall.php not run?










share|improve this question
















bumped to the homepage by Community 15 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • Is there abc_incommproduct_setup in core_resource? If so, does it have the version you specified in config.xml? What happens if you remove that record from core_resource, clear the cache, clear the sessions and give it another go?

    – Henry's Cat
    May 14 '15 at 13:23











  • Did you update the config.xml file version in the module where the SQL upgrade file is located?

    – eetzen
    May 14 '15 at 17:16











  • is not core_resource because i have used a model in my folder /model , dont work ... and yes, my config.xml have same version of the sql upgrade,

    – Matheus Silva Itep
    May 14 '15 at 23:24














3












3








3








I am creating a module to insert a new attribute and a new type of product in my store. As template, I use the same registration screen of the Virtual Product type and include new options ONLY this type of product.
For this, in my config.xml, I used:



<catalog>
<product>
<type>
<incomm_virtual translate="label" module="incomm">
<label>Incomm Virtual</label>
<model>incomm/product_type</model>
<price_model>incomm/product_price</price_model>
<is_qty>1</is_qty>
<composite>0</composite>
<can_use_qty_decimals>0</can_use_qty_decimals>
</incomm_virtual>
</type>
</product>
</catalog>


and to configure the installation with the sql in same config.xml:



    <resources>
<abc_incommproduct_setup>
<setup>
<module>ABC_Incomm</module>
<class>Mage_Catalog_Model_Resource_Setup</class>
</setup>
</abc_incommproduct_setup>
</resources>


The next file was used mymodule / model / product / type.php containing:



class ABC_Incomm_Model_Product_Type
extends Mage_Catalog_Model_Product_Type_Virtual
{
const TYPE_INCOMM = 'incomm';
const XML_PATH_AUTHENTICATION = 'catalog/incomm/authentication';

protected function _prepareProduct(Varien_Object $buyRequest, $product, $processMode)
{
if ($this->_isStrictProcessMode($processMode)) {
return Mage::helper('ABC_Incomm_Helper_Data')->__(
'Incomm product %s cannot be added to cart. ' .
' On the product detail page click the "Go to parent site"'.
' button to access the product.',
$product->getName()
);
}
return parent::_prepareProduct($buyRequest, $product, $processMode);
}
}


In the same folder, the virtual.php:



class ABC_Incomm_Model_Product_Virtual extends Mage_Catalog_Model_Product_Type_Virtual {   
}


Finally, the SQL installation file in sql folder / abc_incommproduct_setup / mysql-install-4-0.1.0.php:



$this->startSetup();

$this->addAttribute(Mage_Catalog_Model_Product::ENTITY, 'terms_of_use', array(
'group' => 'General',
'input' => 'textarea',
'type' => 'text',
'sort_order' => 4,
'label' => 'Terms of use',
'backend' => '',
'visible' => true,
'required' => true,
'wysiwyg_enabled' => true,
'visible_on_front' => true,
'apply_to' => 'incomm', //only in this type of product
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
));

$this->endSetup();


My problem is this, after disabling the cache in magento, clear the cache and include a new type of product, in the Product Types list appears my NEW type of product, but the options NOT load the new attribute inserted via SQL. Did sqlinstall.php not run?










share|improve this question
















I am creating a module to insert a new attribute and a new type of product in my store. As template, I use the same registration screen of the Virtual Product type and include new options ONLY this type of product.
For this, in my config.xml, I used:



<catalog>
<product>
<type>
<incomm_virtual translate="label" module="incomm">
<label>Incomm Virtual</label>
<model>incomm/product_type</model>
<price_model>incomm/product_price</price_model>
<is_qty>1</is_qty>
<composite>0</composite>
<can_use_qty_decimals>0</can_use_qty_decimals>
</incomm_virtual>
</type>
</product>
</catalog>


and to configure the installation with the sql in same config.xml:



    <resources>
<abc_incommproduct_setup>
<setup>
<module>ABC_Incomm</module>
<class>Mage_Catalog_Model_Resource_Setup</class>
</setup>
</abc_incommproduct_setup>
</resources>


The next file was used mymodule / model / product / type.php containing:



class ABC_Incomm_Model_Product_Type
extends Mage_Catalog_Model_Product_Type_Virtual
{
const TYPE_INCOMM = 'incomm';
const XML_PATH_AUTHENTICATION = 'catalog/incomm/authentication';

protected function _prepareProduct(Varien_Object $buyRequest, $product, $processMode)
{
if ($this->_isStrictProcessMode($processMode)) {
return Mage::helper('ABC_Incomm_Helper_Data')->__(
'Incomm product %s cannot be added to cart. ' .
' On the product detail page click the "Go to parent site"'.
' button to access the product.',
$product->getName()
);
}
return parent::_prepareProduct($buyRequest, $product, $processMode);
}
}


In the same folder, the virtual.php:



class ABC_Incomm_Model_Product_Virtual extends Mage_Catalog_Model_Product_Type_Virtual {   
}


Finally, the SQL installation file in sql folder / abc_incommproduct_setup / mysql-install-4-0.1.0.php:



$this->startSetup();

$this->addAttribute(Mage_Catalog_Model_Product::ENTITY, 'terms_of_use', array(
'group' => 'General',
'input' => 'textarea',
'type' => 'text',
'sort_order' => 4,
'label' => 'Terms of use',
'backend' => '',
'visible' => true,
'required' => true,
'wysiwyg_enabled' => true,
'visible_on_front' => true,
'apply_to' => 'incomm', //only in this type of product
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
));

$this->endSetup();


My problem is this, after disabling the cache in magento, clear the cache and include a new type of product, in the Product Types list appears my NEW type of product, but the options NOT load the new attribute inserted via SQL. Did sqlinstall.php not run?







product-attribute install-script virtual-products






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 1 '16 at 20:50









Fabian Schmengler

55.5k21139354




55.5k21139354










asked May 14 '15 at 12:43









Matheus Silva ItepMatheus Silva Itep

181116




181116





bumped to the homepage by Community 15 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 15 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • Is there abc_incommproduct_setup in core_resource? If so, does it have the version you specified in config.xml? What happens if you remove that record from core_resource, clear the cache, clear the sessions and give it another go?

    – Henry's Cat
    May 14 '15 at 13:23











  • Did you update the config.xml file version in the module where the SQL upgrade file is located?

    – eetzen
    May 14 '15 at 17:16











  • is not core_resource because i have used a model in my folder /model , dont work ... and yes, my config.xml have same version of the sql upgrade,

    – Matheus Silva Itep
    May 14 '15 at 23:24



















  • Is there abc_incommproduct_setup in core_resource? If so, does it have the version you specified in config.xml? What happens if you remove that record from core_resource, clear the cache, clear the sessions and give it another go?

    – Henry's Cat
    May 14 '15 at 13:23











  • Did you update the config.xml file version in the module where the SQL upgrade file is located?

    – eetzen
    May 14 '15 at 17:16











  • is not core_resource because i have used a model in my folder /model , dont work ... and yes, my config.xml have same version of the sql upgrade,

    – Matheus Silva Itep
    May 14 '15 at 23:24

















Is there abc_incommproduct_setup in core_resource? If so, does it have the version you specified in config.xml? What happens if you remove that record from core_resource, clear the cache, clear the sessions and give it another go?

– Henry's Cat
May 14 '15 at 13:23





Is there abc_incommproduct_setup in core_resource? If so, does it have the version you specified in config.xml? What happens if you remove that record from core_resource, clear the cache, clear the sessions and give it another go?

– Henry's Cat
May 14 '15 at 13:23













Did you update the config.xml file version in the module where the SQL upgrade file is located?

– eetzen
May 14 '15 at 17:16





Did you update the config.xml file version in the module where the SQL upgrade file is located?

– eetzen
May 14 '15 at 17:16













is not core_resource because i have used a model in my folder /model , dont work ... and yes, my config.xml have same version of the sql upgrade,

– Matheus Silva Itep
May 14 '15 at 23:24





is not core_resource because i have used a model in my folder /model , dont work ... and yes, my config.xml have same version of the sql upgrade,

– Matheus Silva Itep
May 14 '15 at 23:24










1 Answer
1






active

oldest

votes


















0














Try this:



$this->startSetup();

$this->addAttribute(Mage_Catalog_Model_Product::ENTITY, 'terms_of_use', array(
'group' => 'General',
'input' => 'textarea',
'type' => 'text',
'sort_order' => 4,
'label' => 'Terms of use',
'backend' => '',
'visible' => true,
'required' => true,
'wysiwyg_enabled' => true,
'visible_on_front' => true,
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
));

$installer->updateAttribute(Mage_Catalog_Model_Product::ENTITY, 'terms_of_use', 'apply_to', 'incomm');

$this->endSetup();





share|improve this answer
























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "479"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f67891%2fneed-to-create-a-new-attribute-in-a-new-type-of-product%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Try this:



    $this->startSetup();

    $this->addAttribute(Mage_Catalog_Model_Product::ENTITY, 'terms_of_use', array(
    'group' => 'General',
    'input' => 'textarea',
    'type' => 'text',
    'sort_order' => 4,
    'label' => 'Terms of use',
    'backend' => '',
    'visible' => true,
    'required' => true,
    'wysiwyg_enabled' => true,
    'visible_on_front' => true,
    'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
    ));

    $installer->updateAttribute(Mage_Catalog_Model_Product::ENTITY, 'terms_of_use', 'apply_to', 'incomm');

    $this->endSetup();





    share|improve this answer




























      0














      Try this:



      $this->startSetup();

      $this->addAttribute(Mage_Catalog_Model_Product::ENTITY, 'terms_of_use', array(
      'group' => 'General',
      'input' => 'textarea',
      'type' => 'text',
      'sort_order' => 4,
      'label' => 'Terms of use',
      'backend' => '',
      'visible' => true,
      'required' => true,
      'wysiwyg_enabled' => true,
      'visible_on_front' => true,
      'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
      ));

      $installer->updateAttribute(Mage_Catalog_Model_Product::ENTITY, 'terms_of_use', 'apply_to', 'incomm');

      $this->endSetup();





      share|improve this answer


























        0












        0








        0







        Try this:



        $this->startSetup();

        $this->addAttribute(Mage_Catalog_Model_Product::ENTITY, 'terms_of_use', array(
        'group' => 'General',
        'input' => 'textarea',
        'type' => 'text',
        'sort_order' => 4,
        'label' => 'Terms of use',
        'backend' => '',
        'visible' => true,
        'required' => true,
        'wysiwyg_enabled' => true,
        'visible_on_front' => true,
        'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
        ));

        $installer->updateAttribute(Mage_Catalog_Model_Product::ENTITY, 'terms_of_use', 'apply_to', 'incomm');

        $this->endSetup();





        share|improve this answer













        Try this:



        $this->startSetup();

        $this->addAttribute(Mage_Catalog_Model_Product::ENTITY, 'terms_of_use', array(
        'group' => 'General',
        'input' => 'textarea',
        'type' => 'text',
        'sort_order' => 4,
        'label' => 'Terms of use',
        'backend' => '',
        'visible' => true,
        'required' => true,
        'wysiwyg_enabled' => true,
        'visible_on_front' => true,
        'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
        ));

        $installer->updateAttribute(Mage_Catalog_Model_Product::ENTITY, 'terms_of_use', 'apply_to', 'incomm');

        $this->endSetup();






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 1 '16 at 22:52









        SeStroSeStro

        760515




        760515






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Magento Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f67891%2fneed-to-create-a-new-attribute-in-a-new-type-of-product%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            “%fieldName is a required field.”, in Magento2 REST API Call for GET Method Type The Next...

            How to change City field to a dropdown in Checkout step Magento 2Magento 2 : How to change UI field(s)...

            變成蝙蝠會怎樣? 參考資料 外部連結 导航菜单Thomas Nagel, "What is it like to be a...