Need to create a new attribute in a new type of productcreate 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?

Pre-plastic human skin alternative

Two field separators (colon and space) in awk

How does Captain America channel this power?

Does Gita support doctrine of eternal samsara?

Minor Revision with suggestion of an alternative proof by reviewer

Why did C use the -> operator instead of reusing the . operator?

Providing evidence of Consent of Parents for Marriage by minor in England in early 1800s?

Get consecutive integer number ranges from list of int

How to fry ground beef so it is well-browned

Check if a string is entirely made of the same substring

Can someone publish a story that happened to you?

Pulling the rope with one hand is as heavy as with two hands?

Don’t seats that recline flat defeat the purpose of having seatbelts?

What are the characteristics of a typeless programming language?

What is the philosophical significance of speech acts/implicature?

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?

Can SQL Server create collisions in system generated constraint names?

What happens to Mjolnir (Thor's hammer) at the end of Endgame?

Can we say “you can pay when the order gets ready”?

Relationship between strut and baselineskip

Re-entry to Germany after vacation using blue card

Why was the Spitfire's elliptical wing almost uncopied by other aircraft of World War 2?

How did Captain America manage to do this?



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 5 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 5 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 5 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 5 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

            Can not update quote_id field of “quote_item” table magento 2Magento 2.1 - We can't remove the item. (Shopping Cart doesnt allow us to remove items before becomes empty)Add value for custom quote item attribute using REST apiREST API endpoint v1/carts/cartId/items always returns error messageCorrect way to save entries to databaseHow to remove all associated quote objects of a customer completelyMagento 2 - Save value from custom input field to quote_itemGet quote_item data using quote id and product id filter in Magento 2How to set additional data to quote_item table from controller in Magento 2?What is the purpose of additional_data column in quote_item table in magento2Set Custom Price to Quote item magento2 from controller

            Magento 2 disable Secret Key on URL's from terminal The Next CEO of Stack OverflowMagento 2 Shortcut/GUI tool to perform commandline tasks for windowsIn menu add configuration linkMagento oAuth : Generating access token and access secretMagento 2 security key issue in Third-Party API redirect URIPublic actions in admin controllersHow to Disable Cache in Custom WidgetURL Key not changing in Magento 2Product URL Key gets deleted when importing custom options - Magento 2Problem with reindex terminalMagento 2 - bin/magento Commands not working in Cpanel Terminal

            Aasi (pallopeli) Navigointivalikko