mollie/magento2-analytics 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mollie/magento2-analytics

最新稳定版本:v1.0.1

Composer 安装命令:

composer require mollie/magento2-analytics

包简介

Mollie Payment Analytics Module for Magento 2

README 文档

README

Mollie Analytics Addon for Magento 2.3.x and higher

This plugin is an addon on the Mollie Magento 2 payment module and can't be installed seperatly without the Mollie Payment plugin installed.

Installation

We recommend that you make a backup of your webshop files, as well as the database.

Step-by-step to install the Magento® 2 extension through Composer:

  1. Make sure the Mollie Magento 2 payment module is installed.
  2. Connect to your server running Magento® 2 using SSH or other method (make sure you have access to the command line).
  3. Locate your Magento® 2 project root.
  4. Install the Magento® 2 extension through composer and wait till it's completed:
composer require mollie/magento2-analytics
  1. Once completed run the Magento® module enable command:
bin/magento module:enable Mollie_Analytics
  1. After that run the Magento® upgrade and clean the caches:
php bin/magento setup:upgrade
php bin/magento cache:flush
  1. If Magento® is running in production mode you also need to redeploy the static content:
php bin/magento setup:static-content:deploy

Usage

When enabled, this module will extract the client ID from the Google Analytics cookie and save it. When the user finishes the transaction this will get appended to the success URL: &clientId=<value>. You can retrieve this by using javascript:

const urlParams = new URLSearchParams(window.location.search);
const clientId = urlParams.get('clientId');

console.log('Receive client id:', clientId);

Another way to retrieve the ID is by using the repository:

class DoSomeStuff {
    /**
     * @var \Mollie\Analytics\Api\AnalyticsRepositoryInterface
     */
    private $repository;

    public function __construct(
        \Mollie\Analytics\Api\AnalyticsRepositoryInterface $repository
    ) {
        $this->repository = $repository;
    }

    public function getClientId(int $cartId): ?string
    {
        return $this->repository->getByCartId($cartId)->getClientId();
    }
}

License

BSD (Berkeley Software Distribution) License. Copyright (c) 2011-2021, Mollie B.V.

统计信息

  • 总下载量: 10.42k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 1

GitHub 信息

  • Stars: 0
  • Watchers: 4
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: OSL-3.0
  • 更新时间: 2022-07-21