You need create column with name save_print in this table.
Setup/InstallData.php
<?php
namespace Vendor\Module\Setup;
use Magento\Eav\Setup\EavSetup;
use Magento\Eav\Setup\EavSetupFactory;
use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
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(
\Magento\Catalog\Model\Product::ENTITY,
"save_print ",
[
'group' => "",
'label' => "save_print ",
'is_html_allowed_on_front' => true,
'default' => '1',
'note' => '',
'global' => \Magento\Catalog\Model\ResourceModel\Eav\Attribute::SCOPE_STORE,
'visible' => true,
'required' => false,
'user_defined' => false,
'searchable' => false,
'filterable' => false,
'comparable' => false,
'visible_on_front' => true,
'visible_in_advanced_search' => false,
'unique' => false,
"frontend_class" => "",
"used_in_product_listing" => true,
"input" => "select",
"type" => "int",
"source" => "Magento\Config\Model\Config\Source\Yesno",
'backend' => 'Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend'
]
);
}
}
All done, please run the upgrade script php bin/magento setup:upgrade
to install the module and the product attribute sample_attribute will be created. After run upgrade complete, please run php
bin/magento setup:static-content:deploy.