Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yotpo compatibility with >4 and drop > 3 #839

Merged
merged 5 commits into from
Dec 27, 2023
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ All notable changes to this project will be documented in this file. This projec

### Unreleased
* Replace deprecated Zend_db_select usage
* Update Yotpo compatibility to > 4.1 and remove < 3.3

### 7.3.1
* Fix issue with category export where default categories were not exported correctly
Expand Down
6 changes: 3 additions & 3 deletions Helper/Ratings.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ private function getRatingsFromProviders(Product $product, Store $store)
try {
$this->setRegistryProduct($product);

$ratings = $this->ratingsFactory->create()->getRichSnippet();
$ratings = $this->ratingsFactory->create()->getRichSnippet($product->getId());
} catch (Exception $e) {
$this->resetRegistryProduct();
$this->logger->exception($e);
Expand Down Expand Up @@ -254,9 +254,9 @@ private function buildReviewCount(Product $product, Store $store)
*/
public function canUseYotpo()
{
if ($this->moduleManager->isEnabled('Yotpo_Yotpo') &&
if ($this->moduleManager->isEnabled('Yotpo_Reviews') &&
// phpcs:ignore
class_exists('Yotpo\Yotpo\Helper\RichSnippets') &&
class_exists('Yotpo\Reviews\Model\Sync\RichSnippets') &&
method_exists($this->ratingsFactory->create(), 'getRichSnippet')
) {
return true;
Expand Down
4 changes: 2 additions & 2 deletions Helper/RatingsFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
namespace Nosto\Tagging\Helper;

use Magento\Framework\ObjectManagerInterface;
use Yotpo\Yotpo\Helper\RichSnippets;
use Yotpo\Reviews\Model\Sync\RichSnippets;

class RatingsFactory
{
Expand All @@ -62,6 +62,6 @@ public function __construct(ObjectManagerInterface $objectManager)
public function create()
{
/** @phan-suppress-next-line PhanUndeclaredTypeReturnType */
return $this->objectManager->create('Yotpo\Yotpo\Helper\RichSnippets'); // @codingStandardsIgnoreLine
return $this->objectManager->create('Yotpo\Reviews\Model\Sync\RichSnippets'); // @codingStandardsIgnoreLine
}
}
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
"magento/module-asynchronous-operations": "100.4.3",
"phan/phan": "5.3.0",
"drenso/phan-extensions": "3.5.1",
"yotpo/module-review": "^2.9",
"yotpo/module-yotpo-combined": "^4.1",
"phpunit/phpunit": "~9.5.18"
},
"suggest": {
"magento/product-community-edition": "2.*",
"yotpo/module-review": "^2.9"
"yotpo/module-yotpo-combined": "^4.1"
},
"license": [
"OSL-3.0"
Expand Down
Loading
Loading