Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
namespace NicolasBejean\Customer\Helper;
use Magento\Customer\Api\Data\AddressInterface;
use Magento\Customer\Api\Data\CustomerInterface;
use Magento\Framework\App\Helper\AbstractHelper;
use Magento\Framework\App\Helper\Context;
/**
* Class SendGeoLocation
*
* @category PHP
* @package NicolasBejean\Customer\Helper
* @author Nicolas Béjean <nicolas@bejean.eu>
* @license https://lab.frogg.it/bejean-developpement/magento-2/modules/customer/-/blob/master/LICENCE GPL3 Licence
* @link https://www.bejean.eu
*/
class SendGeoLocation extends AbstractHelper
{
/**
* SendGeoLocation constructor.
* @param Context $context
*/
public function __construct(
Context $context
) {
parent::__construct($context);
}
public function sendDataToApi(CustomerInterface $customer, AddressInterface $address)
{
$createdAt = $customer->getCreatedAt();
$updatedAt = $customer->getUpdatedAt();
$websiteId = $customer->getWebsiteId();
$storeId = $customer->getStoreId();
$customerId = $customer->getId();
$groupId = $customer->getGroupId();
$country = $address->getCountryId();
$city = $address->getCity();
$postCode = $address->getPostcode();
}
}