Categories
CMS Magento Mastering Development

magento 2 in category multi select attribute in option is not show?

:InstallData <?php namespace Vender\Extension\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; use Magento\Catalog\Model\Category\Attribute\Backend\Sortby as SortbyBackendModel; use Magento\Catalog\Model\Category\Attribute\Source\Sortby; 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\Category::ENTITY, ‘choosesubcategoryslider’, [ ‘group’ => ‘Choose […]

Categories
CMS Magento Mastering Development

magento 2 in category multi select attribute in option is not show?

:InstallData <?php namespace Vender\Extension\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; use Magento\Catalog\Model\Category\Attribute\Backend\Sortby as SortbyBackendModel; use Magento\Catalog\Model\Category\Attribute\Source\Sortby; 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\Category::ENTITY, ‘choosesubcategoryslider’, [ ‘group’ => ‘Choose […]

Categories
CMS Magento Mastering Development

magento 2 in category multi select attribute in option is not show?

:InstallData <?php namespace Vender\Extension\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; use Magento\Catalog\Model\Category\Attribute\Backend\Sortby as SortbyBackendModel; use Magento\Catalog\Model\Category\Attribute\Source\Sortby; 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\Category::ENTITY, ‘choosesubcategoryslider’, [ ‘group’ => ‘Choose […]

Categories
CMS Magento Mastering Development

Custom category attribute is not being saved – issue

I managed to create my custom attribute: $installer = $setup; $installer->startSetup(); $categorySetup = $this->categorySetupFactory->create([‘setup’ => $setup]); $categorySetup->addAttribute( Category::ENTITY, ‘content_category_page’, [ ‘type’ => ‘int’, ‘label’ => ‘Content Page’, ‘input’ => ‘select’, ‘sort_order’ => 100, ‘source’ => ‘Magento\Catalog\Model\Category\Attribute\Source\Page’, ‘global’ => 2, ‘visible’ => true, ‘required’ => true, ‘user_defined’ => false, ‘default’ => null, ‘group’ => ‘General Information’, […]

Categories
CMS Magento Mastering Development

Install Data is not executed in magento 2

I am trying to create a category attribute: This is my file form Vendor/Module/Setup: use Magento\Catalog\Model\Category; use Magento\Catalog\Setup\CategorySetupFactory; use Magento\Framework\Setup\InstallDataInterface; use Magento\Framework\Setup\ModuleContextInterface; use Magento\Framework\Setup\ModuleDataSetupInterface; class InstallData implements InstallDataInterface { private $categorySetupFactory; public function __construct(CategorySetupFactory $categorySetupFactory) { $this->categorySetupFactory = $categorySetupFactory; } public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context) { $installer = $setup; $installer->startSetup(); $categorySetup = $this->categorySetupFactory->create([‘setup’ => […]

Categories
Database Development

How to join two table without getting duplicate from right table in Oracle

Tables Details: CREATE TABLE Test2 ( ID INT, Value INT, other INT); CREATE TABLE Test1 ( ID INT, TYPE INT, other INT); INSERT INTO Test2 VALUES (123456, 5, 12); INSERT INTO Test1 VALUES (123456, 00, 2); INSERT INTO Test1 VALUES (123456, 01, 6); INSERT INTO Test1 VALUES (123456, 02, 4); INSERT INTO Test1 VALUES (987654, […]

Categories
CMS Magento Mastering Development

Create 3 product attributes of dropdown, with its values

I am not able to make appear 2 of the 3 new attributes in magento_admin_site here is the code in InstallaData.php <?php namespace Ht\Mymodule\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 […]

Categories
CMS Magento Mastering Development

How to create product attribute and assign it to specific attribute set and attribute set group? Magento 2.3

I have an attribute set with name Gold and attribute set group with name Ring, i want to add a boolean product attribute with name biodynamic like this: $this->moduleDataSetup->getConnection()->startSetup(); /** @var EavSetup $eavSetup */ $eavSetup = $this->eavSetupFactory->create([‘setup’ => $this->moduleDataSetup]); $eavSetup->addAttribute( \Magento\Catalog\Model\Product::ENTITY, ‘biodynamic’, [ ‘type’ => ‘int’, ‘label’ => ‘Biodynamic’, ‘input’ => ‘boolean’, ‘source’ => ”, […]

Categories
CMS Mastering Development Wordpress

Sanitize user input fields before wp_insert_post

I read how to sanitize, validate and escape text fields and I know wp_insert_post sanitizes all field using wp_kses except html tags. However, I’m new to development and would like to be confirmed that I’m going to right place. Now, I’m creating user submitting frontend form. There’re several input fields, 1) Post title, type: text, […]

Categories
CMS Magento Mastering Development

Magento 2 – Can’t save custom Customer attribute value in observer customer_save_after_data_object

I have created three custom attributes for Customer: myapp_id, codice_univoco and indirizzo_pec If I enter a value in codice_univoco and/or indirizzo_pec, data is successfully saved: However, when I insert a value for myapp_id (App ID), and then save, all custom attributes are emptied (including myapp_id): If I check my database, I can see that custom […]