Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions Block/Product/RatingSnippet.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,31 @@

class RatingSnippet extends ListProduct
{
// protected $_storeManager = StoreManagerInterface::class;
protected $_customerSession;
protected $reviewsConfig;
protected $postDataHelper;
protected $layerResolver;
protected $categoryRepository;
protected $urlHelper;
protected $customerSession;
protected $categoryFactory;
//protected $reviewsConfig = Reviews\Helper\Config;
// protected $_storeManager = StoreManagerInterface::class;
protected $reviewsConfigHelper;
protected $storeManager;
protected $store;
protected $reviewsConfig;

/**
* ListProduct constructor.
* @param \Magento\Catalog\Block\Product\Context $context
* @param \Magento\Framework\Data\Helper\PostHelper $postDataHelper
* @param \Magento\Catalog\Model\Layer\Resolver $layerResolver
* @param \Magento\Catalog\Api\CategoryRepositoryInterface $categoryRepository
* @param \Magento\Framework\Url\Helper\Data $urlHelper
* @param Helper $helper
* @param array $data
* @param \Magento\Customer\Model\Session $customerSession
* @param \Magento\Catalog\Model\CategoryFactory $categoryFactory
* @param \Reviewscouk\Reviews\Helper\Config $reviewsConfigHelper
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
*/
public function __construct(
\Magento\Catalog\Block\Product\Context $context,
Expand All @@ -39,10 +47,10 @@ public function __construct(
\Magento\Catalog\Api\CategoryRepositoryInterface $categoryRepository,
\Magento\Framework\Url\Helper\Data $urlHelper,
array $data = [],
\Magento\Customer\Model\Session $customerSession = null,
\Magento\Catalog\Model\CategoryFactory $categoryFactory = null,
ReviewsConfig $reviewsConfigHelper = null,
StoreManagerInterface $storeManager = null
?\Magento\Customer\Model\Session $customerSession = null,
?\Magento\Catalog\Model\CategoryFactory $categoryFactory = null,
?ReviewsConfig $reviewsConfigHelper = null,
?StoreManagerInterface $storeManager = null
) {
$this->_customerSession = $customerSession;
$this->categoryFactory = $categoryFactory;
Expand Down
2 changes: 1 addition & 1 deletion Block/Richsnippet.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function getRichSnippetSource()
return '<script src="' . $url . '"></script>';
}

public function getRichSnippet($sku = null, $product = null)
public function getRichSnippet(?array $sku = null, ?array $product = null)
{
if (isset($sku) && is_array($sku)) {
$sku = implode(';', $sku);
Expand Down
4 changes: 2 additions & 2 deletions Model/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function __construct(
$this->store = $storeManagerInterface->getStore();
}

public function apiPost($url, $data, $magento_store_id = null)
public function apiPost($url, $data, ?string $magento_store_id = null)
{
if ($magento_store_id == null) {
$magento_store_id = $this->store->getId();
Expand All @@ -51,7 +51,7 @@ public function apiPost($url, $data, $magento_store_id = null)
return $response;
}

protected function getApiDomain($magento_store_id = null)
protected function getApiDomain(?string $magento_store_id = null)
{
return $this->configHelper->getRegion($magento_store_id) == 'US' ? 'api.reviews.io' : 'api.reviews.co.uk';
}
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ You'll need to sign up at [Reviews.co.uk](https://www.reviews.co.uk "Reviews.co.

| Magento Version | Php Version | REVIEWS.io Plugin Version |
|-----------------|-------------|----------------------------|
| >= 2.4.8 | 8.3, 8.4 | reviewscouk/reviews:0.0.67 |
| >= 2.4.6 | 8.1, 8.2 | reviewscouk/reviews:0.0.66 |
| >= 2.4.4 | 8.1 | reviewscouk/reviews:0.0.66 |
| <= 2.4.3 | <= 7.4 | reviewscouk/reviews:0.0.66 |
Expand All @@ -18,7 +19,7 @@ You'll need to sign up at [Reviews.co.uk](https://www.reviews.co.uk "Reviews.co.
2. As this plugin is hosted on [packagist.org](http://packagist.org), you simply use the following to instruct composer to fetch and install the module:

```bash
composer require reviewscouk/reviews:0.0.66
composer require reviewscouk/reviews:0.0.67
```

3. When this is complete, `cd` to `/bin` and run the following:
Expand Down