Skip to content

Commit

Permalink
Merge pull request #844 from Nosto/release/7.4.0
Browse files Browse the repository at this point in the history
Release/7.4.0
  • Loading branch information
supercid authored Jan 29, 2024
2 parents 10d9137 + 91a3394 commit b57fe55
Show file tree
Hide file tree
Showing 12 changed files with 550 additions and 374 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
All notable changes to this project will be documented in this file. This project adheres to Semantic Versioning.

### 7.4.0
* Replace deprecated Zend_db_select usage
* Update Yotpo compatibility to > 4.1 and remove < 3.3
* Add db_schema_whitelist.json to ensure database schema changes are applied correctly
* Log error in order builder when failing to convert from base price
* Replace Zend_Uri_Http with Laminas\Uri (@piotrkwiecinski)

### 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
}
}
10 changes: 5 additions & 5 deletions Helper/Url.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
use Nosto\Tagging\Logger\Logger as NostoLogger;
use Nosto\Tagging\Model\Product\Repository as ProductRepository;
use Nosto\Tagging\Model\Product\Url\Builder as NostoUrlBuilder;
use Zend_Uri_Exception;
use Zend_Uri_Http;
use Laminas\Uri\Exception\InvalidArgumentException;
use Laminas\Uri\UriFactory;

/**
* Url helper class for common URL related tasks.
Expand Down Expand Up @@ -188,12 +188,12 @@ public function getActiveDomain(Store $store)
* @param string $currentUrl restore cart url
* @return string cart url.
* @throws NoSuchEntityException
* @throws Zend_Uri_Exception
* @throws InvalidArgumentException
*/
public function getUrlCart(Store $store, string $currentUrl)
{
$zendHttp = Zend_Uri_Http::fromString($currentUrl);
$urlParameters = $zendHttp->getQueryAsArray();
$uri = UriFactory::factory($currentUrl);
$urlParameters = $uri->getQueryAsArray();

$defaultParams = $this->getUrlOptionsWithNoSid($store);
$url = $store->getUrl(
Expand Down
9 changes: 9 additions & 0 deletions Model/Order/Item/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
use Magento\Framework\Exception\LocalizedException;
use Magento\Sales\Model\Order\Item;
use Nosto\Model\Cart\LineItem;
use Nosto\NostoException;
use Nosto\Tagging\Logger\Logger as NostoLogger;
use Nosto\Tagging\Model\Item\Downloadable;
use Nosto\Tagging\Model\Item\Giftcard;
Expand Down Expand Up @@ -142,6 +143,14 @@ public function build(Item $item)
}
$nostoItem->setPrice($price);
} catch (Exception $e) {
$this->logger->exception(
new NostoException(
sprintf(
'Could not calculate order item price, message was: %s',
$e->getMessage()
)
)
);
$nostoItem->setPrice(0);
}

Expand Down
4 changes: 2 additions & 2 deletions Model/ResourceModel/Magento/Category/CollectionBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
use Magento\Sales\Api\Data\EntityInterface;
use Magento\Store\Model\Store;
use Magento\Catalog\Model\ResourceModel\Category\Collection as CategoryCollection;
use Zend_Db_Select;
use Magento\Framework\DB\Select;

/**
* A builder class for building product collection with the most common filters
Expand Down Expand Up @@ -158,7 +158,7 @@ public function reset()
*/
public function init()
{
$this->categoryCollection->clear()->getSelect()->reset(Zend_Db_Select::WHERE);
$this->categoryCollection->clear()->getSelect()->reset(Select::WHERE);
return $this;
}

Expand Down
4 changes: 2 additions & 2 deletions Model/ResourceModel/Magento/Product/CollectionBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
use Magento\Store\Model\Store;
use Nosto\Tagging\Model\ResourceModel\Magento\Product\Collection as ProductCollection;
use Nosto\Tagging\Helper\Data as NostoHelperData;
use Zend_Db_Select;
use Magento\Framework\DB\Select;

/**
* A builder class for building product collection with the most common filters
Expand Down Expand Up @@ -203,7 +203,7 @@ public function reset()
*/
public function init()
{
$this->productCollection->clear()->getSelect()->reset(Zend_Db_Select::WHERE);
$this->productCollection->clear()->getSelect()->reset(Select::WHERE);
return $this;
}

Expand Down
4 changes: 2 additions & 2 deletions Setup/Patch/Data/AddCustomerReference.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Framework\Setup\Patch\DataPatchInterface;
use Nosto\Tagging\Helper\Data as NostoHelperData;
use Zend_Validate_Exception;
use Magento\Framework\Validator\ValidateException;
use Exception;

class AddCustomerReference implements DataPatchInterface
Expand Down Expand Up @@ -102,7 +102,7 @@ public function apply()

/**
* @throws LocalizedException
* @throws Zend_Validate_Exception
* @throws ValidateException
* @throws Exception
*/
public function addCustomerReference()
Expand Down
9 changes: 5 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "nosto/module-nostotagging",
"description": "Increase your conversion rate and average order value by delivering your customers personalized product recommendations throughout their shopping journey.",
"type": "magento2-module",
"version": "7.3.1",
"version": "7.4.0",
"require-dev": {
"phpmd/phpmd": "^2.5",
"sebastian/phpcpd": "*",
Expand All @@ -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 All @@ -41,7 +41,8 @@
"php": ">=7.4.0",
"magento/framework": ">=101.0.6|~104.0",
"ext-json": "*",
"nosto/php-sdk": "^7.1"
"nosto/php-sdk": "^7.1",
"laminas/laminas-uri": "*"
},
"repositories": [
{
Expand Down
Loading

0 comments on commit b57fe55

Please sign in to comment.