Magento 2: Type Error occurred when creating object

I had created a custom API for adding new customer in Magento 2.3. I had injected dependency injection and passed the method to create the customer account. But it gives me below error: main.CRITICAL: Type Error occurred when creating object: MyModule\Customapi\Model\Addcustomer, Too few arguments to function MyModule\Customapi\Model\Addcustomer::__construct(), 7 passed in /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 116 and…

Create Customer custom attribute in magento 2.3

I need to create customer custom attribute as datetime in magento 2.3 Below is my code into Setup/Patch/Data/AddLastPasswordChangeCustomerAttribute.php with apply() funcation public function apply() { $this->moduleDataSetup->getConnection()->startSetup(); /** @var EavSetup $eavSetup */ $eavSetup = $this->eavSetupFactory->create([‘setup’ => $this->moduleDataSetup]); $eavSetup->addAttribute( \Magento\Customer\Model\Customer::ENTITY, ‘last_password_change’, [ ‘type’ => ‘varchar’, ‘label’ => ‘last_password_change’, ‘input’ => ‘text’, ‘source’ => ”, ‘frontend’ => ”,…

Cart total doesnt update after remove an item programatically Magento 2

Events.xml <event name=”controller_action_postdispatch_customer_account_loginPost”> <observer name=”customer_login_observer” instance=”vendor\module\Observer\Customercart” /> </event> Customercart.php <?php namespace vendor\module\Observer; class Customercart implements \Magento\Framework\Event\ObserverInterface { public function __construct( \Magento\Framework\Message\ManagerInterface $messageManager, \Magento\Checkout\Model\Session $session, \Magento\Customer\Model\Session $customerSession, ) { $this->_session = $session; $this->_customerSession = $customerSession; $this->_messageManager = $messageManager; } public function execute(\Magento\Framework\Event\Observer $observer) { $writer = new \Zend\Log\Writer\Stream(BP . ‘/var/log/teqwewq.log’); $logger = new \Zend\Log\Logger(); $logger->addWriter($writer); if($this->_customerSession->isLoggedIn()){…

CRON job not setting up on linux

I have setup the corn command using crontab -e command. MAILTO=”” * * * * * /usr/bin/php7.2 /var/www/vhosts/hostname/httpdocs/bin/magento cron:run –group=”test” I have created module to run CRON job automatically. But it is not working automatically. Instead when I hit command ‘php bin/magento cron:run‘ it works. I am surprised CRON task is performing manually but not…

Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element ‘reference’: This element is not expected

I am getting below error when I go custom simple products details page. It is working when go to simple product detail page. I am using magento porto theme and recently migrated from magento 1.9 to magento 2.3.3 main.INFO: Cache file with merged layout: LAYOUT_frontend_STORE1_40b0d6346f25da66374a88a3ad4a3a7b9_page_layout_merged and handles default, catalog_product_view, catalog_product_view_id_1053, catalog_product_view_sku_JLVMC11611-GS, catalog_product_view_type_simple: Please correct the…

Link eav_attribute_option_value to catalog_product_entity

I want to link an attribute to its product which means link catalog_product_entity to eav_attribute_option_value This is my essay : SELECT DISTINCT catalog_product_entity_text.value AS nom_du_produit, sales_flat_order.created_at AS date_de_commande, sales_flat_order.grand_total AS prix_avant_remise, sales_flat_order.subtotal AS prix_apres_remise, sales_flat_order_address.firstname AS prenom, sales_flat_order_address.lastname As nom, sales_flat_order_address.telephone AS telephone, sales_flat_order_address.country_id AS pays FROM catalog_product_entity cpe, sales_flat_order, sales_flat_order_address, eav_attribute, eav_attribute_option_value, catalog_product_entity_text LEFT…