PHP code example of wika-group / magento2-wika-user-data-api

1. Go to this page and download the library: Download wika-group/magento2-wika-user-data-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

wika-group / magento2-wika-user-data-api example snippets


class Demo {
    public function __construct(
        private \WikaGroup\WikaUserDataApi\Helper\Data $userDataApi,
    ) { }

    public function doWork()
    {
        $userData = $this->userDataApi->getUserData('[email protected]');
        if ($userData === null) {
            // No data found for given email - or error (see log file)
            return;
        }
        
        // Process data
        $userData['id'];
    }
}