Below is my observer code: <?php class CustomerOrderCountObserver implements ObserverInterface { /** * @var customerFactory */ private $customerFactory; /** * * @param CustomerFactory $customerFactory */ public function __construct( CustomerFactory $customerFactory ) { $this->customerFactory = $customerFactory; } /** * Upgrade customer password hash when customer has logged in * * @param MagentoFrameworkEventObserver $observer * @return void */ public function execute(MagentoFrameworkEventObserver $observer)
Tag: magento2
Magento 2 – How to save data after the order was successfull in a custom table
First: I understand how to create a custom module within a customtable in the backend. I had already done this and it works fine and I can save some information with it in the backend. (Name: app/code/TestModule/Module) But now I try to customize the order process. I want to save some data, like the ‘oder_id’ and the ‘order_date’ in a
Sample PHP code to programmatically check SOAP connection in Magento 2
I tried the below code though I am not sure whether these are the required set of scripts, but it didn’t work and gives SOAP-ERROR: Parsing WSDL: Couldn’t load from : Start tag expected, ‘<‘ not found Can anyone share the code to make SOAP connection in Magento2.x In Magento1.x the below code works fine to connect SOAP But the
How to get category collection using product id in product details page in Magento 2
How can I get a category collection in the product details page? I’ve tried using the below code, but it’s not getting the collection. Answer on the product detail page you can just call getCategoryCollection function on product’s Object to get Category Collection as following :