cancel
Showing results for 
Search instead for 
Did you mean: 

How capture the guest checkout signup data into the magento modules

SOLVED

How capture the guest checkout signup data into the magento modules

Hi there

Thanks for the reading the question.  


i want to add the guest checkout to my CRM system  how to capture the guest checkout use data ?

1 ACCEPTED SOLUTION

Accepted Solutions

Re: How capture the guest checkout signup data into the magento modules

Hi @sanjaymakw0653 

 

If you want to use event suggested by me then you may use code like following.

public function execute(Observer $observer): void
{
    $orderIds = $observer->getEvent()->getOrderIds();
    $order = $observer->getEvent()->getOrder();
    $lastOrderId = $orderIds['0'];

     // Your code logic here
}

Thanks

---
Problem Solved Click Accept as Solution!:Magento Community India Forum

View solution in original post

5 REPLIES 5

Re: How capture the guest checkout signup data into the magento modules

Hi @sanjaymakw0653 

 

What exactly do you want to pass to your CRM? The customer details or the order details?

 

Thanks

---
Problem Solved Click Accept as Solution!:Magento Community India Forum

Re: How capture the guest checkout signup data into the magento modules

@Mukesh Tiwari   Thanks for the your reply I want to pass the user and orders data both.
How to achieve this.

Re: How capture the guest checkout signup data into the magento modules

Hi @sanjaymakw0653 

 

If you want to use event observer to capture the order submission data, you may use following event in event.xml

<?xml version="1.0" encoding="UTF-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="checkout_onepage_controller_success_action">
        <observer name="brady_on_order_success_page" instance="Brady\SendOrdersToSap\Observer\OrderSuccess"/>
    </event>
</config>

Then after in the observer you can get the Order data which you may process in some model class.

 

For the customer registration you may use customer_register_success event to get the required data.

 

Thanks

---
Problem Solved Click Accept as Solution!:Magento Community India Forum

Re: How capture the guest checkout signup data into the magento modules

@Mukesh Tiwari 

I used the Event and observers


  <event name="checkout_onepage_controller_success_action">
        <observer name=" my_observer_orderdispatch" instance="__\__\Observer\Orderdispatch" />
    </event>
   <event name="checkout_submit_all_after">
      <observer name="_My____observer_checkout_submit_all_after" instance="__\__\Observer\Customer\RegisterSuccessObserver" />
    </event>
    
    <event name="checkout_allow_guest">
      <observer name="my___observer_checkout_allow_guest" instance="__\__\Observer\Customer\CheckoutGuest" />
    </event>

 

how to fetch the data into observer execution function.

public function execute(EventObserver $observer)
    {
        
    }


can you help me here to get the data here ?.
 

Re: How capture the guest checkout signup data into the magento modules

Hi @sanjaymakw0653 

 

If you want to use event suggested by me then you may use code like following.

public function execute(Observer $observer): void
{
    $orderIds = $observer->getEvent()->getOrderIds();
    $order = $observer->getEvent()->getOrder();
    $lastOrderId = $orderIds['0'];

     // Your code logic here
}

Thanks

---
Problem Solved Click Accept as Solution!:Magento Community India Forum