M2.3.3 : 500 on product creation page after adding attribute programatically

I am adding product attribute programmatically the following way: use Magento\Framework\App\Bootstrap; require ‘/www/public_html/app/bootstrap.php’; $params = $_SERVER; $bootstrap = Bootstrap::create(BP, $params); $obj = $bootstrap->getObjectManager(); $state = $obj->get(‘Magento\Framework\App\State’); $state->setAreaCode(‘frontend’); $eavEavSetupFactory = $obj->create(‘\Magento\Eav\Setup\EavSetupFactory’); $eavConfig = $obj->create(‘\Magento\Eav\Model\Config’); $attributeSetFactory = $obj->create(‘Magento\Eav\Model\Entity\Attribute\SetFactory’); /** @var ProductSetup $productSetup */ $productSetup = $eavEavSetupFactory->create(); $productEntity = $productSetup->getEntityTypeId(‘catalog_product’); $attributeSetId = $productSetup->getDefaultAttributeSetId($productEntity); /** @var $attributeSet AttributeSet */…

setData does not set attributes values

I am creating simple products and try to set some attribute values $attributeSetId = $product->getDefaultAttributeSetId(); $product->setSku($sku); // Set your sku here $product->setName($product_title); // Name of Product $product->setAttributeSetId($attributeSetId); // Attribute set id $product->setStatus(0); // Status on product enabled/ disabled 1/0, disabled by default $product->setWeight(10); // weight of product $product->setVisibility(4); // visibilty of product (catalog / search…

Magento2 disable newsletter success mail

I did google how to do it, I found one solution online https://www.metagento.com/blog/magento-2-disable-newsletter-subscription-success-email https://github.com/metagento/magento-2-disable-newsletter-success-email however I don’t know why I can’t install, I did check the module status, it not showing in the list. even I follow from their website, still no success. php bin/magento setup:upgrade php bin/magento setup:static-content:deploy php bin/magento cache:flush can anyone tell…