How to add a new field to Custom Options The 2019 Stack Overflow Developer Survey Results Are InCreate a sortable and filterable custom attribute to stand-alone entityerror to add custom attributesHow to add a new field (or attribute) on Create Order Page in admin - magento 1.9?Trying to add new custom tab at adminhtml_sales_order_viewadding a image/logo to attributeAdd new tab in custom module admin side after custom account in Magento 1.9.2.4?Magento 1.9 add layout and template to custom module in adminAdd new column to individual options?Translate labels of options from attributeMagento 1: Add custom attribute in transactional e-mail

How can I autofill dates in Excel excluding Sunday?

What is the motivation for a law requiring 2 parties to consent for recording a conversation

Can someone be penalized for an "unlawful" act if no penalty is specified?

slides for 30min~1hr skype tenure track application interview

Which Sci-Fi work first showed weapon of galactic-scale mass destruction?

Does a dangling wire really electrocute me if I'm standing in water?

Can one be advised by a professor who is very far away?

How to deal with fear of taking dependencies

Delete all lines which don't have n characters before delimiter

When should I buy a clipper card after flying to OAK?

Am I thawing this London Broil safely?

"as much details as you can remember"

What is the most effective way of iterating a std::vector and why?

Falsification in Math vs Science

Output the Arecibo Message

What tool would a Roman-age civilization have for the breaking of silver and other metals into dust?

What do hard-Brexiteers want with respect to the Irish border?

How technical should a Scrum Master be to effectively remove impediments?

Can we generate random numbers using irrational numbers like π and e?

What does ひと匙 mean in this manga and has it been used colloquially?

Can you compress metal and what would be the consequences?

Deal with toxic manager when you can't quit

Should I use my personal e-mail address, or my workplace one, when registering to external websites for work purposes?

Reference request: Oldest number theory books with (unsolved) exercises?



How to add a new field to Custom Options



The 2019 Stack Overflow Developer Survey Results Are InCreate a sortable and filterable custom attribute to stand-alone entityerror to add custom attributesHow to add a new field (or attribute) on Create Order Page in admin - magento 1.9?Trying to add new custom tab at adminhtml_sales_order_viewadding a image/logo to attributeAdd new tab in custom module admin side after custom account in Magento 1.9.2.4?Magento 1.9 add layout and template to custom module in adminAdd new column to individual options?Translate labels of options from attributeMagento 1: Add custom attribute in transactional e-mail



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








0















How can I extend the "Custom Options" in a configurable product? I need to add a new field named Identifier. Where can I find the necessary templates?



Custom Field in Backend



I figured out that the template is in appdesignadminhtmldefaultdefaulttemplatecatalogproducteditoptionsoption.phtml, and I added my custom code to it:



enter image description here



But I have no clue to which table I have to add the new attribute "identifier" ?



How can I figure this out?



I thought I have to add it to the table Catalog_Product_Edit_Options_Option because the template is in appdesignadminhtmldefaultdefaulttemplatecatalogproducteditoptionsoption.phtml but this threw an error that the table could not be found.



How do I know the right table name where the attribute belongs to?



I tried to install it to the table catalog_product_option_type_value with this install script but it is not the right table, because if I enter something and save something then it is not saved:



<?php

Mage::log("Add attribute 'identifier' to table 'catalog_product_edit_options_option'", 7, "system.log");

$installer = $this;
$connection = $installer->getConnection();

$installer->startSetup();

$installer->getConnection()
->addColumn($installer->getTable('catalog_product_option_type_value'),
'identifier',
array(
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
'input' => 'text',
'nullable' => true,
'default' => null,
'comment' => 'Identifier of the Option, used to perform specific actions in scripts only on options with certain identifiers.'
)
);

$installer->endSetup();


I also added it to the table catalog_product_option but it still does not save.



Update:
I noticed that the value is actually stored into the database, but magento fails to load it in the backend so it looks like it is empty. I used this query



SELECT * FROM `magecatalog_product_option` WHERE `option_id` = 443`


enter image description here



Why does it not show in the backend?










share|improve this question






























    0















    How can I extend the "Custom Options" in a configurable product? I need to add a new field named Identifier. Where can I find the necessary templates?



    Custom Field in Backend



    I figured out that the template is in appdesignadminhtmldefaultdefaulttemplatecatalogproducteditoptionsoption.phtml, and I added my custom code to it:



    enter image description here



    But I have no clue to which table I have to add the new attribute "identifier" ?



    How can I figure this out?



    I thought I have to add it to the table Catalog_Product_Edit_Options_Option because the template is in appdesignadminhtmldefaultdefaulttemplatecatalogproducteditoptionsoption.phtml but this threw an error that the table could not be found.



    How do I know the right table name where the attribute belongs to?



    I tried to install it to the table catalog_product_option_type_value with this install script but it is not the right table, because if I enter something and save something then it is not saved:



    <?php

    Mage::log("Add attribute 'identifier' to table 'catalog_product_edit_options_option'", 7, "system.log");

    $installer = $this;
    $connection = $installer->getConnection();

    $installer->startSetup();

    $installer->getConnection()
    ->addColumn($installer->getTable('catalog_product_option_type_value'),
    'identifier',
    array(
    'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
    'input' => 'text',
    'nullable' => true,
    'default' => null,
    'comment' => 'Identifier of the Option, used to perform specific actions in scripts only on options with certain identifiers.'
    )
    );

    $installer->endSetup();


    I also added it to the table catalog_product_option but it still does not save.



    Update:
    I noticed that the value is actually stored into the database, but magento fails to load it in the backend so it looks like it is empty. I used this query



    SELECT * FROM `magecatalog_product_option` WHERE `option_id` = 443`


    enter image description here



    Why does it not show in the backend?










    share|improve this question


























      0












      0








      0


      1






      How can I extend the "Custom Options" in a configurable product? I need to add a new field named Identifier. Where can I find the necessary templates?



      Custom Field in Backend



      I figured out that the template is in appdesignadminhtmldefaultdefaulttemplatecatalogproducteditoptionsoption.phtml, and I added my custom code to it:



      enter image description here



      But I have no clue to which table I have to add the new attribute "identifier" ?



      How can I figure this out?



      I thought I have to add it to the table Catalog_Product_Edit_Options_Option because the template is in appdesignadminhtmldefaultdefaulttemplatecatalogproducteditoptionsoption.phtml but this threw an error that the table could not be found.



      How do I know the right table name where the attribute belongs to?



      I tried to install it to the table catalog_product_option_type_value with this install script but it is not the right table, because if I enter something and save something then it is not saved:



      <?php

      Mage::log("Add attribute 'identifier' to table 'catalog_product_edit_options_option'", 7, "system.log");

      $installer = $this;
      $connection = $installer->getConnection();

      $installer->startSetup();

      $installer->getConnection()
      ->addColumn($installer->getTable('catalog_product_option_type_value'),
      'identifier',
      array(
      'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
      'input' => 'text',
      'nullable' => true,
      'default' => null,
      'comment' => 'Identifier of the Option, used to perform specific actions in scripts only on options with certain identifiers.'
      )
      );

      $installer->endSetup();


      I also added it to the table catalog_product_option but it still does not save.



      Update:
      I noticed that the value is actually stored into the database, but magento fails to load it in the backend so it looks like it is empty. I used this query



      SELECT * FROM `magecatalog_product_option` WHERE `option_id` = 443`


      enter image description here



      Why does it not show in the backend?










      share|improve this question
















      How can I extend the "Custom Options" in a configurable product? I need to add a new field named Identifier. Where can I find the necessary templates?



      Custom Field in Backend



      I figured out that the template is in appdesignadminhtmldefaultdefaulttemplatecatalogproducteditoptionsoption.phtml, and I added my custom code to it:



      enter image description here



      But I have no clue to which table I have to add the new attribute "identifier" ?



      How can I figure this out?



      I thought I have to add it to the table Catalog_Product_Edit_Options_Option because the template is in appdesignadminhtmldefaultdefaulttemplatecatalogproducteditoptionsoption.phtml but this threw an error that the table could not be found.



      How do I know the right table name where the attribute belongs to?



      I tried to install it to the table catalog_product_option_type_value with this install script but it is not the right table, because if I enter something and save something then it is not saved:



      <?php

      Mage::log("Add attribute 'identifier' to table 'catalog_product_edit_options_option'", 7, "system.log");

      $installer = $this;
      $connection = $installer->getConnection();

      $installer->startSetup();

      $installer->getConnection()
      ->addColumn($installer->getTable('catalog_product_option_type_value'),
      'identifier',
      array(
      'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
      'input' => 'text',
      'nullable' => true,
      'default' => null,
      'comment' => 'Identifier of the Option, used to perform specific actions in scripts only on options with certain identifiers.'
      )
      );

      $installer->endSetup();


      I also added it to the table catalog_product_option but it still does not save.



      Update:
      I noticed that the value is actually stored into the database, but magento fails to load it in the backend so it looks like it is empty. I used this query



      SELECT * FROM `magecatalog_product_option` WHERE `option_id` = 443`


      enter image description here



      Why does it not show in the backend?







      magento-1.9 attributes adminhtml custom-options install-script






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited yesterday







      Black

















      asked yesterday









      BlackBlack

      421320




      421320




















          1 Answer
          1






          active

          oldest

          votes


















          1














          You are more than half the way done :-)



          You have to overwrite the block Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Option also and add your new column identifier in the method getOptionValues().



          Add $value['identifier'] = $option->getIdentifier(); for example after $value['sort_order'] = $option->getSortOrder(); and with that you should have the data in the backend






          share|improve this answer


















          • 2





            Thx!! You saved my day :) Note: You should first search for classes which extends the class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Option to figure out if there are already overrides. I had a overwrite in one of my extensions in app/code/local. Never edit core files!

            – Black
            yesterday






          • 2





            I didn't say 'change code in Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Option', but 'overwrite the block Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Option' which means for me to create your own block extending that block. Sorry if the answer can be misunderstood.

            – HelgeB
            yesterday











          • Yes I know, I just added the note in case someone does not know it

            – Black
            yesterday











          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%2f269366%2fhow-to-add-a-new-field-to-custom-options%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









          1














          You are more than half the way done :-)



          You have to overwrite the block Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Option also and add your new column identifier in the method getOptionValues().



          Add $value['identifier'] = $option->getIdentifier(); for example after $value['sort_order'] = $option->getSortOrder(); and with that you should have the data in the backend






          share|improve this answer


















          • 2





            Thx!! You saved my day :) Note: You should first search for classes which extends the class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Option to figure out if there are already overrides. I had a overwrite in one of my extensions in app/code/local. Never edit core files!

            – Black
            yesterday






          • 2





            I didn't say 'change code in Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Option', but 'overwrite the block Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Option' which means for me to create your own block extending that block. Sorry if the answer can be misunderstood.

            – HelgeB
            yesterday











          • Yes I know, I just added the note in case someone does not know it

            – Black
            yesterday















          1














          You are more than half the way done :-)



          You have to overwrite the block Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Option also and add your new column identifier in the method getOptionValues().



          Add $value['identifier'] = $option->getIdentifier(); for example after $value['sort_order'] = $option->getSortOrder(); and with that you should have the data in the backend






          share|improve this answer


















          • 2





            Thx!! You saved my day :) Note: You should first search for classes which extends the class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Option to figure out if there are already overrides. I had a overwrite in one of my extensions in app/code/local. Never edit core files!

            – Black
            yesterday






          • 2





            I didn't say 'change code in Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Option', but 'overwrite the block Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Option' which means for me to create your own block extending that block. Sorry if the answer can be misunderstood.

            – HelgeB
            yesterday











          • Yes I know, I just added the note in case someone does not know it

            – Black
            yesterday













          1












          1








          1







          You are more than half the way done :-)



          You have to overwrite the block Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Option also and add your new column identifier in the method getOptionValues().



          Add $value['identifier'] = $option->getIdentifier(); for example after $value['sort_order'] = $option->getSortOrder(); and with that you should have the data in the backend






          share|improve this answer













          You are more than half the way done :-)



          You have to overwrite the block Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Option also and add your new column identifier in the method getOptionValues().



          Add $value['identifier'] = $option->getIdentifier(); for example after $value['sort_order'] = $option->getSortOrder(); and with that you should have the data in the backend







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered yesterday









          HelgeBHelgeB

          3,1981323




          3,1981323







          • 2





            Thx!! You saved my day :) Note: You should first search for classes which extends the class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Option to figure out if there are already overrides. I had a overwrite in one of my extensions in app/code/local. Never edit core files!

            – Black
            yesterday






          • 2





            I didn't say 'change code in Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Option', but 'overwrite the block Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Option' which means for me to create your own block extending that block. Sorry if the answer can be misunderstood.

            – HelgeB
            yesterday











          • Yes I know, I just added the note in case someone does not know it

            – Black
            yesterday












          • 2





            Thx!! You saved my day :) Note: You should first search for classes which extends the class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Option to figure out if there are already overrides. I had a overwrite in one of my extensions in app/code/local. Never edit core files!

            – Black
            yesterday






          • 2





            I didn't say 'change code in Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Option', but 'overwrite the block Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Option' which means for me to create your own block extending that block. Sorry if the answer can be misunderstood.

            – HelgeB
            yesterday











          • Yes I know, I just added the note in case someone does not know it

            – Black
            yesterday







          2




          2





          Thx!! You saved my day :) Note: You should first search for classes which extends the class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Option to figure out if there are already overrides. I had a overwrite in one of my extensions in app/code/local. Never edit core files!

          – Black
          yesterday





          Thx!! You saved my day :) Note: You should first search for classes which extends the class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Option to figure out if there are already overrides. I had a overwrite in one of my extensions in app/code/local. Never edit core files!

          – Black
          yesterday




          2




          2





          I didn't say 'change code in Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Option', but 'overwrite the block Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Option' which means for me to create your own block extending that block. Sorry if the answer can be misunderstood.

          – HelgeB
          yesterday





          I didn't say 'change code in Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Option', but 'overwrite the block Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Option' which means for me to create your own block extending that block. Sorry if the answer can be misunderstood.

          – HelgeB
          yesterday













          Yes I know, I just added the note in case someone does not know it

          – Black
          yesterday





          Yes I know, I just added the note in case someone does not know it

          – Black
          yesterday

















          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%2f269366%2fhow-to-add-a-new-field-to-custom-options%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

          Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

          Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

          Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?