-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/develop'
# Conflicts: # CHANGELOG.md # composer.json
- Loading branch information
Showing
20 changed files
with
229 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
/** | ||
* Copyright (C) 2024 Pixel Développement | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace PixelOpen\Plausible\Plugin; | ||
|
||
use Magento\Catalog\Controller\Category\View; | ||
use Magento\Framework\Controller\ResultInterface; | ||
use PixelOpen\Plausible\Helper\Config; | ||
use PixelOpen\Plausible\Session\Goals; | ||
|
||
class GoalCategory | ||
{ | ||
protected Goals $goals; | ||
|
||
public function __construct( | ||
Goals $goals | ||
) { | ||
$this->goals = $goals; | ||
} | ||
|
||
/** | ||
* Add goal when customer visits a category | ||
*/ | ||
public function afterExecute(View $subject, ResultInterface $result): ResultInterface | ||
{ | ||
$this->goals->add(Config::PLAUSIBLE_GOAL_CATEGORY); | ||
|
||
return $result; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
/** | ||
* Copyright (C) 2024 Pixel Développement | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace PixelOpen\Plausible\Plugin; | ||
|
||
use Magento\Customer\Controller\Ajax\Login; | ||
use Magento\Framework\Controller\ResultInterface; | ||
use PixelOpen\Plausible\Helper\Config; | ||
use PixelOpen\Plausible\Session\Goals; | ||
|
||
class GoalLoginAjax | ||
{ | ||
protected Goals $goals; | ||
|
||
public function __construct( | ||
Goals $goals | ||
) { | ||
$this->goals = $goals; | ||
} | ||
|
||
/** | ||
* Add goal after customer was connected | ||
*/ | ||
public function afterExecute(Login $subject, ResultInterface $result): ResultInterface | ||
{ | ||
$this->goals->add(Config::PLAUSIBLE_GOAL_LOGIN); | ||
|
||
return $result; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
/** | ||
* Copyright (C) 2024 Pixel Développement | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace PixelOpen\Plausible\Plugin; | ||
|
||
use Magento\Catalog\Controller\Product\View; | ||
use Magento\Framework\Controller\ResultInterface; | ||
use PixelOpen\Plausible\Helper\Config; | ||
use PixelOpen\Plausible\Session\Goals; | ||
|
||
class GoalProduct | ||
{ | ||
protected Goals $goals; | ||
|
||
public function __construct( | ||
Goals $goals | ||
) { | ||
$this->goals = $goals; | ||
} | ||
|
||
/** | ||
* Add goal when customer visits a product page | ||
*/ | ||
public function afterExecute(View $subject, ResultInterface $result): ResultInterface | ||
{ | ||
$this->goals->add(Config::PLAUSIBLE_GOAL_PRODUCT); | ||
|
||
return $result; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.