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
Mastering Development

Trying to upload data into Database but Nodejs always throwing error of Cast to ObjectId? React & NodeJS

HEADS UP, I WILL POST EVERY CODE THAT I’M USING FOR THIS, NOT ONLY THE NODEJS CODE BUT THE REACTJS AS WELL, ETC. So I’m trying to upload some inputs into my database but everytime I do it, it throws me an error Cast to ObjectId failed for value “null” at path “_id” for model […]

Categories
CMS Magento Mastering Development

eav_attribute_option and eav_attribute_option_value not getting updated after adding custom attribute to customer admin

Basically I have been trying to add custom attribute in customer admin using upgrade data and customer setup. But here I can see in my db that my new custom attribute have been added successfully in eav_attribute,customer_eav_attribute,eav_entity_attribute also I am able to see that attribute in customer/admin/edit form in account information tab where I wanted […]

Categories
CMS Magento Mastering Development

eav_attribute_option and eav_attribute_option_value not getting updated after adding custom attribute to customer admin

Basically I have been trying to add custom attribute in customer admin using upgrade data and customer setup. But here I can see in my db that my new custom attribute have been added successfully in eav_attribute,customer_eav_attribute,eav_entity_attribute also I am able to see that attribute in customer/admin/edit form in account information tab where I wanted […]

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

Filtering SelectControl items according the input from another SelectControl in Gutenberg Block (ES5, no JSX)

I have 2 SelectControl from a WordPress Gutenberg Custom Block I’m trying to build. I don’t use ES6. Only ES5 and no JSX. The 2 SelectControl should work in the following way: They fetch from REST WP Api the Post Types and all the Posts. What I want to achieve is when I select an […]

Categories
CMS Magento Mastering Development

Magento 2 : Avoid duplicating code Marketplace issue

I’ve submitted the extension in Marketplace and it shows below error, The files: myvendor/module-custommodule/MCS/Product.php myvendor/module-custommodule/MCS/Template.php are too similar to the Magento 2 files: magento/module-eav/magento-module-eav-102.0.0-beta32/Model/Entity/Attribute/Source/Boolean.php magento/module-config/magento-module-config-101.1.0-beta32/Model/Config/Source/Email/Template.php To avoid duplicating code, use class preferences. Template.php <?php namespace Vendor\Module\Model\Config\Source; /** * Templates classs */ class Template extends \Magento\Framework\DataObject implements \Magento\Framework\Option\ArrayInterface { /** * core Registry * * @var […]

Categories
CMS Magento Mastering Development

How to add Custom Registeration field from admin

Hi i have a form in admin and i want that when select the type this values should reflect on an appropriate selected form but am not able to do so can anyone guide me here is a screenshot InstallSchema.php <?php /** * @category Eecom * @package Eecom_CustomCustomerAttribute */ namespace Eecom\CustomCustomerAttribute\Setup; use Magento\Framework\Setup\InstallSchemaInterface; use Magento\Framework\Setup\ModuleContextInterface; […]

Categories
Mastering Development

org.apache.avro.AvroTypeException: Expected record-start. Got VALUE_STRING

I am doing simple json to Avro Record conversion, But I am getting this issue, I tried lot of ways, I applied more than 15 solutions from stackoverflow and online. My File look like this { “namespace”: “test”, “type”: “record”, “name”: “root”, “doc”: “This stream contains raw data.”, “fields”: [ { “name”: “aaa”, “doc”: “You […]