Custom Attribute is not saving data in database












0















I'm trying to add custom text box named cashback in Magento 2 product add/edit page. I added the text box programmatically. But my below code doesn't add column in the table also not saving the value. I'm a beginner so I can't understand Magento 2 structure. I need clarification about which table does it stores and need to store data given in admin panel.



<?php

namespace RkWalletSetup;

use MagentoEavSetupEavSetup;
use MagentoEavSetupEavSetupFactory;
use MagentoFrameworkSetupInstallDataInterface;
use MagentoFrameworkSetupModuleContextInterface;
use MagentoFrameworkSetupModuleDataSetupInterface;

class InstallData implements InstallDataInterface
{
private $eavSetupFactory;
public function __construct(
EavSetupFactory $eavSetupFactory
)
{
$this->eavSetupFactory = $eavSetupFactory;
}

public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{
$eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
$eavSetup->addAttribute(
"cashback",
[
'group' => "",
'label' => "Cashback",
'is_html_allowed_on_front' => true,
'default' => '1',
'note' => '',
'global' => MagentoCatalogModelResourceModelEavAttribute::SCOPE_STORE,
'visible' => true,
'required' => false,
'user_defined' => true,
'searchable' => true,
'filterable' => true,
'comparable' => false,
'visible_on_front' => true,
'visible_in_advanced_search' => false,
'unique' => false,
"frontend_class" => "cashbackclass",
"used_in_product_listing" => true,
"type" => "int",
"input" => "text",
"type" => "int",
"source" => "VendorModuleModelConfigSourceTimeSetup",
'backend' => 'MagentoEavModelEntityAttributeBackendArrayBackend'
]
);
}
}









share|improve this question
















bumped to the homepage by Community 7 mins ago


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




















    0















    I'm trying to add custom text box named cashback in Magento 2 product add/edit page. I added the text box programmatically. But my below code doesn't add column in the table also not saving the value. I'm a beginner so I can't understand Magento 2 structure. I need clarification about which table does it stores and need to store data given in admin panel.



    <?php

    namespace RkWalletSetup;

    use MagentoEavSetupEavSetup;
    use MagentoEavSetupEavSetupFactory;
    use MagentoFrameworkSetupInstallDataInterface;
    use MagentoFrameworkSetupModuleContextInterface;
    use MagentoFrameworkSetupModuleDataSetupInterface;

    class InstallData implements InstallDataInterface
    {
    private $eavSetupFactory;
    public function __construct(
    EavSetupFactory $eavSetupFactory
    )
    {
    $this->eavSetupFactory = $eavSetupFactory;
    }

    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
    $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
    $eavSetup->addAttribute(
    "cashback",
    [
    'group' => "",
    'label' => "Cashback",
    'is_html_allowed_on_front' => true,
    'default' => '1',
    'note' => '',
    'global' => MagentoCatalogModelResourceModelEavAttribute::SCOPE_STORE,
    'visible' => true,
    'required' => false,
    'user_defined' => true,
    'searchable' => true,
    'filterable' => true,
    'comparable' => false,
    'visible_on_front' => true,
    'visible_in_advanced_search' => false,
    'unique' => false,
    "frontend_class" => "cashbackclass",
    "used_in_product_listing" => true,
    "type" => "int",
    "input" => "text",
    "type" => "int",
    "source" => "VendorModuleModelConfigSourceTimeSetup",
    'backend' => 'MagentoEavModelEntityAttributeBackendArrayBackend'
    ]
    );
    }
    }









    share|improve this question
















    bumped to the homepage by Community 7 mins ago


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


















      0












      0








      0


      1






      I'm trying to add custom text box named cashback in Magento 2 product add/edit page. I added the text box programmatically. But my below code doesn't add column in the table also not saving the value. I'm a beginner so I can't understand Magento 2 structure. I need clarification about which table does it stores and need to store data given in admin panel.



      <?php

      namespace RkWalletSetup;

      use MagentoEavSetupEavSetup;
      use MagentoEavSetupEavSetupFactory;
      use MagentoFrameworkSetupInstallDataInterface;
      use MagentoFrameworkSetupModuleContextInterface;
      use MagentoFrameworkSetupModuleDataSetupInterface;

      class InstallData implements InstallDataInterface
      {
      private $eavSetupFactory;
      public function __construct(
      EavSetupFactory $eavSetupFactory
      )
      {
      $this->eavSetupFactory = $eavSetupFactory;
      }

      public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
      {
      $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
      $eavSetup->addAttribute(
      "cashback",
      [
      'group' => "",
      'label' => "Cashback",
      'is_html_allowed_on_front' => true,
      'default' => '1',
      'note' => '',
      'global' => MagentoCatalogModelResourceModelEavAttribute::SCOPE_STORE,
      'visible' => true,
      'required' => false,
      'user_defined' => true,
      'searchable' => true,
      'filterable' => true,
      'comparable' => false,
      'visible_on_front' => true,
      'visible_in_advanced_search' => false,
      'unique' => false,
      "frontend_class" => "cashbackclass",
      "used_in_product_listing" => true,
      "type" => "int",
      "input" => "text",
      "type" => "int",
      "source" => "VendorModuleModelConfigSourceTimeSetup",
      'backend' => 'MagentoEavModelEntityAttributeBackendArrayBackend'
      ]
      );
      }
      }









      share|improve this question
















      I'm trying to add custom text box named cashback in Magento 2 product add/edit page. I added the text box programmatically. But my below code doesn't add column in the table also not saving the value. I'm a beginner so I can't understand Magento 2 structure. I need clarification about which table does it stores and need to store data given in admin panel.



      <?php

      namespace RkWalletSetup;

      use MagentoEavSetupEavSetup;
      use MagentoEavSetupEavSetupFactory;
      use MagentoFrameworkSetupInstallDataInterface;
      use MagentoFrameworkSetupModuleContextInterface;
      use MagentoFrameworkSetupModuleDataSetupInterface;

      class InstallData implements InstallDataInterface
      {
      private $eavSetupFactory;
      public function __construct(
      EavSetupFactory $eavSetupFactory
      )
      {
      $this->eavSetupFactory = $eavSetupFactory;
      }

      public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
      {
      $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
      $eavSetup->addAttribute(
      "cashback",
      [
      'group' => "",
      'label' => "Cashback",
      'is_html_allowed_on_front' => true,
      'default' => '1',
      'note' => '',
      'global' => MagentoCatalogModelResourceModelEavAttribute::SCOPE_STORE,
      'visible' => true,
      'required' => false,
      'user_defined' => true,
      'searchable' => true,
      'filterable' => true,
      'comparable' => false,
      'visible_on_front' => true,
      'visible_in_advanced_search' => false,
      'unique' => false,
      "frontend_class" => "cashbackclass",
      "used_in_product_listing" => true,
      "type" => "int",
      "input" => "text",
      "type" => "int",
      "source" => "VendorModuleModelConfigSourceTimeSetup",
      'backend' => 'MagentoEavModelEntityAttributeBackendArrayBackend'
      ]
      );
      }
      }






      magento2 database product-attribute installdata






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 8 '17 at 8:22









      Amrit Pal Singh

      741523




      741523










      asked Nov 8 '17 at 7:58









      Ramesh KRRamesh KR

      311110




      311110





      bumped to the homepage by Community 7 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 7 mins ago


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
























          2 Answers
          2






          active

          oldest

          votes


















          0














          Magento 2 stores setup data/schema versions in setup_module table. I think that first what you have done was to run setup:upgrade after you added module and according version was set in table.



          InstallData/Schema scripts are run only when there is no version stored in db, so at the first run of setup upgrade. If my assumption is correct then either remove relevant entry in setup_module table or put your script into UpgradeData and update module's version in etc/module.xml to higher.



          Check other UpgradeData scripts to see how you can compare versions.






          share|improve this answer
























          • thanks @Bartosh but also after upgrading setup and module version it remains the same.

            – Ramesh KR
            Nov 8 '17 at 8:46











          • Thanks @Bartosh after removing module record the table value saved.

            – Ramesh KR
            Nov 9 '17 at 5:32



















          0














          There are some errors in your script. please try this.



          public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context) {
          /** @var EavSetup $eavSetup */
          $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);

          $eavSetup->addAttribute(
          MagentoCatalogModelProduct::ENTITY, 'cashback', [
          'group' => 'Product Details',
          'type' => 'text',
          'sort_order' => 102,
          'backend' => '',
          'frontend' => '',
          'label' => 'CashBack',
          'input' => 'textarea',
          'class' => '',
          'source' => 'MagentoEavModelEntityAttributeSourceBoolean',
          'global' => MagentoCatalogModelResourceModelEavAttribute::SCOPE_GLOBAL,
          'visible' => true,
          'required' => false,
          'user_defined' => true,
          'default' => '',
          'searchable' => true,
          'filterable' => true,
          'comparable' => false,
          'visible_on_front' => true,
          'used_in_product_listing' => true,
          'unique' => false,
          'apply_to' => 'simple,configurable,virtual,bundle,downloadable'
          ]);
          }


          Note: Remove the entry of your module from setup_module table. Also check the attribute named cashback in eav_attribute table. If you find one, remove that as well.






          share|improve this answer
























          • thanks @Sachin Agarwal above code not added column in eav_attribute table. I need your help. I added new textbox named 'cashback' in adminpanel. Now I need to add the entered value in the text box to the new column in catalog_product_entity table. Pls help me.

            – Ramesh KR
            Nov 8 '17 at 8:45











          • @RameshKR You don't need to add a new column in the catalog_product_entity table. The eav_attribute table must a record for this cashback record. So catalog_product_entity_varchar table will store the value of this cashback attribute with the attribute_id which you ca find in the eav_attribute table.

            – Yogesh Agarwal
            Nov 8 '17 at 9:40











          • also no column like cashback found in eav_attribute tabel

            – Ramesh KR
            Nov 8 '17 at 10:15













          • @RameshKR FYI: eav_attribute doesn't have a new column. it has new record (Row) for you attribute.

            – Yogesh Agarwal
            Nov 9 '17 at 4:42











          • Thanks Sachin Agarwal. Cashback attribute code is updated in db. I have a text box in magento product edit page. I need to save the value given in the text box into the db. After entering data into text box and giving save it's not saving the value. For example if I give 10 in the text box in have to save. This is my logic. Pls help I searched lot of tutorials but I'm a beginner.

            – Ramesh KR
            Nov 9 '17 at 4:45













          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%2f200511%2fcustom-attribute-is-not-saving-data-in-database%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          Magento 2 stores setup data/schema versions in setup_module table. I think that first what you have done was to run setup:upgrade after you added module and according version was set in table.



          InstallData/Schema scripts are run only when there is no version stored in db, so at the first run of setup upgrade. If my assumption is correct then either remove relevant entry in setup_module table or put your script into UpgradeData and update module's version in etc/module.xml to higher.



          Check other UpgradeData scripts to see how you can compare versions.






          share|improve this answer
























          • thanks @Bartosh but also after upgrading setup and module version it remains the same.

            – Ramesh KR
            Nov 8 '17 at 8:46











          • Thanks @Bartosh after removing module record the table value saved.

            – Ramesh KR
            Nov 9 '17 at 5:32
















          0














          Magento 2 stores setup data/schema versions in setup_module table. I think that first what you have done was to run setup:upgrade after you added module and according version was set in table.



          InstallData/Schema scripts are run only when there is no version stored in db, so at the first run of setup upgrade. If my assumption is correct then either remove relevant entry in setup_module table or put your script into UpgradeData and update module's version in etc/module.xml to higher.



          Check other UpgradeData scripts to see how you can compare versions.






          share|improve this answer
























          • thanks @Bartosh but also after upgrading setup and module version it remains the same.

            – Ramesh KR
            Nov 8 '17 at 8:46











          • Thanks @Bartosh after removing module record the table value saved.

            – Ramesh KR
            Nov 9 '17 at 5:32














          0












          0








          0







          Magento 2 stores setup data/schema versions in setup_module table. I think that first what you have done was to run setup:upgrade after you added module and according version was set in table.



          InstallData/Schema scripts are run only when there is no version stored in db, so at the first run of setup upgrade. If my assumption is correct then either remove relevant entry in setup_module table or put your script into UpgradeData and update module's version in etc/module.xml to higher.



          Check other UpgradeData scripts to see how you can compare versions.






          share|improve this answer













          Magento 2 stores setup data/schema versions in setup_module table. I think that first what you have done was to run setup:upgrade after you added module and according version was set in table.



          InstallData/Schema scripts are run only when there is no version stored in db, so at the first run of setup upgrade. If my assumption is correct then either remove relevant entry in setup_module table or put your script into UpgradeData and update module's version in etc/module.xml to higher.



          Check other UpgradeData scripts to see how you can compare versions.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 8 '17 at 8:18









          Bartosz HerbaBartosz Herba

          93518




          93518













          • thanks @Bartosh but also after upgrading setup and module version it remains the same.

            – Ramesh KR
            Nov 8 '17 at 8:46











          • Thanks @Bartosh after removing module record the table value saved.

            – Ramesh KR
            Nov 9 '17 at 5:32



















          • thanks @Bartosh but also after upgrading setup and module version it remains the same.

            – Ramesh KR
            Nov 8 '17 at 8:46











          • Thanks @Bartosh after removing module record the table value saved.

            – Ramesh KR
            Nov 9 '17 at 5:32

















          thanks @Bartosh but also after upgrading setup and module version it remains the same.

          – Ramesh KR
          Nov 8 '17 at 8:46





          thanks @Bartosh but also after upgrading setup and module version it remains the same.

          – Ramesh KR
          Nov 8 '17 at 8:46













          Thanks @Bartosh after removing module record the table value saved.

          – Ramesh KR
          Nov 9 '17 at 5:32





          Thanks @Bartosh after removing module record the table value saved.

          – Ramesh KR
          Nov 9 '17 at 5:32













          0














          There are some errors in your script. please try this.



          public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context) {
          /** @var EavSetup $eavSetup */
          $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);

          $eavSetup->addAttribute(
          MagentoCatalogModelProduct::ENTITY, 'cashback', [
          'group' => 'Product Details',
          'type' => 'text',
          'sort_order' => 102,
          'backend' => '',
          'frontend' => '',
          'label' => 'CashBack',
          'input' => 'textarea',
          'class' => '',
          'source' => 'MagentoEavModelEntityAttributeSourceBoolean',
          'global' => MagentoCatalogModelResourceModelEavAttribute::SCOPE_GLOBAL,
          'visible' => true,
          'required' => false,
          'user_defined' => true,
          'default' => '',
          'searchable' => true,
          'filterable' => true,
          'comparable' => false,
          'visible_on_front' => true,
          'used_in_product_listing' => true,
          'unique' => false,
          'apply_to' => 'simple,configurable,virtual,bundle,downloadable'
          ]);
          }


          Note: Remove the entry of your module from setup_module table. Also check the attribute named cashback in eav_attribute table. If you find one, remove that as well.






          share|improve this answer
























          • thanks @Sachin Agarwal above code not added column in eav_attribute table. I need your help. I added new textbox named 'cashback' in adminpanel. Now I need to add the entered value in the text box to the new column in catalog_product_entity table. Pls help me.

            – Ramesh KR
            Nov 8 '17 at 8:45











          • @RameshKR You don't need to add a new column in the catalog_product_entity table. The eav_attribute table must a record for this cashback record. So catalog_product_entity_varchar table will store the value of this cashback attribute with the attribute_id which you ca find in the eav_attribute table.

            – Yogesh Agarwal
            Nov 8 '17 at 9:40











          • also no column like cashback found in eav_attribute tabel

            – Ramesh KR
            Nov 8 '17 at 10:15













          • @RameshKR FYI: eav_attribute doesn't have a new column. it has new record (Row) for you attribute.

            – Yogesh Agarwal
            Nov 9 '17 at 4:42











          • Thanks Sachin Agarwal. Cashback attribute code is updated in db. I have a text box in magento product edit page. I need to save the value given in the text box into the db. After entering data into text box and giving save it's not saving the value. For example if I give 10 in the text box in have to save. This is my logic. Pls help I searched lot of tutorials but I'm a beginner.

            – Ramesh KR
            Nov 9 '17 at 4:45


















          0














          There are some errors in your script. please try this.



          public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context) {
          /** @var EavSetup $eavSetup */
          $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);

          $eavSetup->addAttribute(
          MagentoCatalogModelProduct::ENTITY, 'cashback', [
          'group' => 'Product Details',
          'type' => 'text',
          'sort_order' => 102,
          'backend' => '',
          'frontend' => '',
          'label' => 'CashBack',
          'input' => 'textarea',
          'class' => '',
          'source' => 'MagentoEavModelEntityAttributeSourceBoolean',
          'global' => MagentoCatalogModelResourceModelEavAttribute::SCOPE_GLOBAL,
          'visible' => true,
          'required' => false,
          'user_defined' => true,
          'default' => '',
          'searchable' => true,
          'filterable' => true,
          'comparable' => false,
          'visible_on_front' => true,
          'used_in_product_listing' => true,
          'unique' => false,
          'apply_to' => 'simple,configurable,virtual,bundle,downloadable'
          ]);
          }


          Note: Remove the entry of your module from setup_module table. Also check the attribute named cashback in eav_attribute table. If you find one, remove that as well.






          share|improve this answer
























          • thanks @Sachin Agarwal above code not added column in eav_attribute table. I need your help. I added new textbox named 'cashback' in adminpanel. Now I need to add the entered value in the text box to the new column in catalog_product_entity table. Pls help me.

            – Ramesh KR
            Nov 8 '17 at 8:45











          • @RameshKR You don't need to add a new column in the catalog_product_entity table. The eav_attribute table must a record for this cashback record. So catalog_product_entity_varchar table will store the value of this cashback attribute with the attribute_id which you ca find in the eav_attribute table.

            – Yogesh Agarwal
            Nov 8 '17 at 9:40











          • also no column like cashback found in eav_attribute tabel

            – Ramesh KR
            Nov 8 '17 at 10:15













          • @RameshKR FYI: eav_attribute doesn't have a new column. it has new record (Row) for you attribute.

            – Yogesh Agarwal
            Nov 9 '17 at 4:42











          • Thanks Sachin Agarwal. Cashback attribute code is updated in db. I have a text box in magento product edit page. I need to save the value given in the text box into the db. After entering data into text box and giving save it's not saving the value. For example if I give 10 in the text box in have to save. This is my logic. Pls help I searched lot of tutorials but I'm a beginner.

            – Ramesh KR
            Nov 9 '17 at 4:45
















          0












          0








          0







          There are some errors in your script. please try this.



          public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context) {
          /** @var EavSetup $eavSetup */
          $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);

          $eavSetup->addAttribute(
          MagentoCatalogModelProduct::ENTITY, 'cashback', [
          'group' => 'Product Details',
          'type' => 'text',
          'sort_order' => 102,
          'backend' => '',
          'frontend' => '',
          'label' => 'CashBack',
          'input' => 'textarea',
          'class' => '',
          'source' => 'MagentoEavModelEntityAttributeSourceBoolean',
          'global' => MagentoCatalogModelResourceModelEavAttribute::SCOPE_GLOBAL,
          'visible' => true,
          'required' => false,
          'user_defined' => true,
          'default' => '',
          'searchable' => true,
          'filterable' => true,
          'comparable' => false,
          'visible_on_front' => true,
          'used_in_product_listing' => true,
          'unique' => false,
          'apply_to' => 'simple,configurable,virtual,bundle,downloadable'
          ]);
          }


          Note: Remove the entry of your module from setup_module table. Also check the attribute named cashback in eav_attribute table. If you find one, remove that as well.






          share|improve this answer













          There are some errors in your script. please try this.



          public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context) {
          /** @var EavSetup $eavSetup */
          $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);

          $eavSetup->addAttribute(
          MagentoCatalogModelProduct::ENTITY, 'cashback', [
          'group' => 'Product Details',
          'type' => 'text',
          'sort_order' => 102,
          'backend' => '',
          'frontend' => '',
          'label' => 'CashBack',
          'input' => 'textarea',
          'class' => '',
          'source' => 'MagentoEavModelEntityAttributeSourceBoolean',
          'global' => MagentoCatalogModelResourceModelEavAttribute::SCOPE_GLOBAL,
          'visible' => true,
          'required' => false,
          'user_defined' => true,
          'default' => '',
          'searchable' => true,
          'filterable' => true,
          'comparable' => false,
          'visible_on_front' => true,
          'used_in_product_listing' => true,
          'unique' => false,
          'apply_to' => 'simple,configurable,virtual,bundle,downloadable'
          ]);
          }


          Note: Remove the entry of your module from setup_module table. Also check the attribute named cashback in eav_attribute table. If you find one, remove that as well.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 8 '17 at 8:23









          Yogesh AgarwalYogesh Agarwal

          687315




          687315













          • thanks @Sachin Agarwal above code not added column in eav_attribute table. I need your help. I added new textbox named 'cashback' in adminpanel. Now I need to add the entered value in the text box to the new column in catalog_product_entity table. Pls help me.

            – Ramesh KR
            Nov 8 '17 at 8:45











          • @RameshKR You don't need to add a new column in the catalog_product_entity table. The eav_attribute table must a record for this cashback record. So catalog_product_entity_varchar table will store the value of this cashback attribute with the attribute_id which you ca find in the eav_attribute table.

            – Yogesh Agarwal
            Nov 8 '17 at 9:40











          • also no column like cashback found in eav_attribute tabel

            – Ramesh KR
            Nov 8 '17 at 10:15













          • @RameshKR FYI: eav_attribute doesn't have a new column. it has new record (Row) for you attribute.

            – Yogesh Agarwal
            Nov 9 '17 at 4:42











          • Thanks Sachin Agarwal. Cashback attribute code is updated in db. I have a text box in magento product edit page. I need to save the value given in the text box into the db. After entering data into text box and giving save it's not saving the value. For example if I give 10 in the text box in have to save. This is my logic. Pls help I searched lot of tutorials but I'm a beginner.

            – Ramesh KR
            Nov 9 '17 at 4:45





















          • thanks @Sachin Agarwal above code not added column in eav_attribute table. I need your help. I added new textbox named 'cashback' in adminpanel. Now I need to add the entered value in the text box to the new column in catalog_product_entity table. Pls help me.

            – Ramesh KR
            Nov 8 '17 at 8:45











          • @RameshKR You don't need to add a new column in the catalog_product_entity table. The eav_attribute table must a record for this cashback record. So catalog_product_entity_varchar table will store the value of this cashback attribute with the attribute_id which you ca find in the eav_attribute table.

            – Yogesh Agarwal
            Nov 8 '17 at 9:40











          • also no column like cashback found in eav_attribute tabel

            – Ramesh KR
            Nov 8 '17 at 10:15













          • @RameshKR FYI: eav_attribute doesn't have a new column. it has new record (Row) for you attribute.

            – Yogesh Agarwal
            Nov 9 '17 at 4:42











          • Thanks Sachin Agarwal. Cashback attribute code is updated in db. I have a text box in magento product edit page. I need to save the value given in the text box into the db. After entering data into text box and giving save it's not saving the value. For example if I give 10 in the text box in have to save. This is my logic. Pls help I searched lot of tutorials but I'm a beginner.

            – Ramesh KR
            Nov 9 '17 at 4:45



















          thanks @Sachin Agarwal above code not added column in eav_attribute table. I need your help. I added new textbox named 'cashback' in adminpanel. Now I need to add the entered value in the text box to the new column in catalog_product_entity table. Pls help me.

          – Ramesh KR
          Nov 8 '17 at 8:45





          thanks @Sachin Agarwal above code not added column in eav_attribute table. I need your help. I added new textbox named 'cashback' in adminpanel. Now I need to add the entered value in the text box to the new column in catalog_product_entity table. Pls help me.

          – Ramesh KR
          Nov 8 '17 at 8:45













          @RameshKR You don't need to add a new column in the catalog_product_entity table. The eav_attribute table must a record for this cashback record. So catalog_product_entity_varchar table will store the value of this cashback attribute with the attribute_id which you ca find in the eav_attribute table.

          – Yogesh Agarwal
          Nov 8 '17 at 9:40





          @RameshKR You don't need to add a new column in the catalog_product_entity table. The eav_attribute table must a record for this cashback record. So catalog_product_entity_varchar table will store the value of this cashback attribute with the attribute_id which you ca find in the eav_attribute table.

          – Yogesh Agarwal
          Nov 8 '17 at 9:40













          also no column like cashback found in eav_attribute tabel

          – Ramesh KR
          Nov 8 '17 at 10:15







          also no column like cashback found in eav_attribute tabel

          – Ramesh KR
          Nov 8 '17 at 10:15















          @RameshKR FYI: eav_attribute doesn't have a new column. it has new record (Row) for you attribute.

          – Yogesh Agarwal
          Nov 9 '17 at 4:42





          @RameshKR FYI: eav_attribute doesn't have a new column. it has new record (Row) for you attribute.

          – Yogesh Agarwal
          Nov 9 '17 at 4:42













          Thanks Sachin Agarwal. Cashback attribute code is updated in db. I have a text box in magento product edit page. I need to save the value given in the text box into the db. After entering data into text box and giving save it's not saving the value. For example if I give 10 in the text box in have to save. This is my logic. Pls help I searched lot of tutorials but I'm a beginner.

          – Ramesh KR
          Nov 9 '17 at 4:45







          Thanks Sachin Agarwal. Cashback attribute code is updated in db. I have a text box in magento product edit page. I need to save the value given in the text box into the db. After entering data into text box and giving save it's not saving the value. For example if I give 10 in the text box in have to save. This is my logic. Pls help I searched lot of tutorials but I'm a beginner.

          – Ramesh KR
          Nov 9 '17 at 4:45




















          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%2f200511%2fcustom-attribute-is-not-saving-data-in-database%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

          Polycentropodidae

          Magento 2 Error message: Invalid state change requested

          Paulmy