Skip to content

Commit

Permalink
Better fix for product edit pages
Browse files Browse the repository at this point in the history
  • Loading branch information
jissereitsma committed Mar 14, 2023
1 parent d5af3d9 commit f9a1cc4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [3.0.17] - 14 March 2023
### Fixed
- Better fix for product edit pages

## [3.0.16] - 13 March 2023
### Fixed
- Cast prices to float in orders and order items #133 (@lfolco)
Expand Down
9 changes: 5 additions & 4 deletions Util/GetCurrentProduct.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);

namespace Yireo\GoogleTagManager2\Util;

Expand All @@ -23,18 +24,18 @@ public function __construct(
$this->productRepository = $productRepository;
$this->storeManager = $storeManager;
}

/**
* @return ProductInterface
* @throws NoSuchEntityException
*/
public function get(): ProductInterface
{
$productId = (int)$this->request->getParam('id');
if (empty($productId)) {
if ($this->request->getActionName() === 'configure' || empty($productId)) {
$productId = (int)$this->request->getParam('product_id');
}

return $this->productRepository->getById($productId, false, $this->storeManager->getStore()->getId());
}
}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yireo/magento2-googletagmanager2",
"version": "3.0.16",
"version": "3.0.17",
"license": "OSL-3.0",
"type": "magento2-module",
"homepage": "https://www.yireo.com/software/magento-extensions/googletagmanager2",
Expand Down

0 comments on commit f9a1cc4

Please sign in to comment.