Skip to content

Commit

Permalink
Merge pull request #851 from Nosto/release/7.5.1
Browse files Browse the repository at this point in the history
Release/7.5.1
  • Loading branch information
supercid authored Apr 18, 2024
2 parents 4a9371a + 02b764f commit 782db1b
Show file tree
Hide file tree
Showing 9 changed files with 328 additions and 440 deletions.
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 2
registries:
adobe:
type: composer-repository
url: https://repo.magento.com
username: ${{ secrets.REPO_USR }}
password: ${{ secrets.REPO_PSW }}

updates:
- package-ecosystem: composer
directory: "/"
schedule:
interval: weekly
open-pull-requests-limit: 0
registries:
- adobe
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
All notable changes to this project will be documented in this file. This project adheres to Semantic Versioning.

### 7.5.1
* Upgrade SDK to 7.4
* Remove PII information from Order Export
* Query speed-up when building categories
* Crypto utilities now use GCM mode

### 7.5.0
* Add category parent id to tagging and product data

Expand Down
12 changes: 2 additions & 10 deletions Model/Order/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
use Nosto\Model\Order\OrderStatus;
use Nosto\NostoException;
use Nosto\Tagging\Logger\Logger as NostoLogger;
use Nosto\Tagging\Model\Order\Buyer\Builder as NostoBuyerBuilder;
use Nosto\Tagging\Model\Order\Item\Builder as NostoOrderItemBuilder;

class Builder
Expand All @@ -63,27 +62,23 @@ class Builder
private SalesRuleFactory $salesRuleFactory;
private NostoOrderItemBuilder $nostoOrderItemBuilder;
private ManagerInterface $eventManager;
private NostoBuyerBuilder $buyerBuilder;

/**
* @param NostoLogger $logger
* @param SalesRuleFactory $salesRuleFactory
* @param NostoOrderItemBuilder $nostoOrderItemBuilder
* @param ManagerInterface $eventManager
* @param NostoBuyerBuilder $buyerBuilder
*/
public function __construct(
NostoLogger $logger,
SalesRuleFactory $salesRuleFactory,
NostoOrderItemBuilder $nostoOrderItemBuilder,
ManagerInterface $eventManager,
NostoBuyerBuilder $buyerBuilder
ManagerInterface $eventManager
) {
$this->logger = $logger;
$this->salesRuleFactory = $salesRuleFactory;
$this->nostoOrderItemBuilder = $nostoOrderItemBuilder;
$this->eventManager = $eventManager;
$this->buyerBuilder = $buyerBuilder;
}

/**
Expand Down Expand Up @@ -120,10 +115,7 @@ public function build(Order $order)
}
$nostoOrder->setOrderStatus($nostoStatus);
}
$nostoBuyer = $this->buyerBuilder->fromOrder($order);
if ($nostoBuyer instanceof Buyer) {
$nostoOrder->setCustomer($nostoBuyer);
}
$nostoOrder->setCustomer(new Buyer());

// Add each ordered item as a line item
/** @var Item $item */
Expand Down
107 changes: 0 additions & 107 deletions Model/Order/Buyer/Builder.php

This file was deleted.

12 changes: 3 additions & 9 deletions Model/Service/Product/Category/DefaultCategoryService.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,9 @@
namespace Nosto\Tagging\Model\Service\Product\Category;

use Exception;
use Magento\Catalog\Api\CategoryRepositoryInterface;
use Magento\Catalog\Model\Category;
use Magento\Catalog\Model\Product;
use Magento\Catalog\Model\ResourceModel\Category\CollectionFactory;
use Magento\Catalog\Model\ResourceModel\Category\Collection;
use Magento\Framework\Event\ManagerInterface;
use Magento\Store\Api\Data\StoreInterface;
use Nosto\Tagging\Logger\Logger as NostoLogger;
Expand All @@ -50,24 +48,20 @@ class DefaultCategoryService implements CategoryServiceInterface
{

private NostoLogger $logger;
private CategoryRepositoryInterface $categoryRepository;
private CollectionFactory $categoryCollectionFactory;
private ManagerInterface $eventManager;

/**
* Builder constructor.
* @param CategoryRepositoryInterface $categoryRepository
* @param CollectionFactory $categoryCollectionFactory
* @param NostoLogger $logger
* @param ManagerInterface $eventManager
*/
public function __construct(
CategoryRepositoryInterface $categoryRepository,
CollectionFactory $categoryCollectionFactory,
NostoLogger $logger,
ManagerInterface $eventManager
) {
$this->categoryRepository = $categoryRepository;
$this->categoryCollectionFactory = $categoryCollectionFactory;
$this->logger = $logger;
$this->eventManager = $eventManager;
Expand Down Expand Up @@ -111,10 +105,11 @@ public function getCategory(Category $category, StoreInterface $store)
}

$categories = $this->categoryCollectionFactory->create()
->addAttributeToSelect('*')
->addAttributeToSelect('name')
->addAttributeToSelect('level')
->addAttributeToFilter('entity_id', $categoryIds)
->setStore($store->getId())
->addAttributeToSort('level', Collection::SORT_ORDER_ASC);
->addAttributeToSort('level');
foreach ($categories as $cat) {
if ($cat instanceof Category
&& $cat->getLevel() > 1
Expand All @@ -135,7 +130,6 @@ public function getCategory(Category $category, StoreInterface $store)
['categoryString' => $nostoCategory, 'magentoCategory' => $category]
);
}

return $nostoCategory;
}

Expand Down
2 changes: 0 additions & 2 deletions Observer/Order/Save.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
use Magento\Framework\Module\Manager as ModuleManager;
use Magento\Sales\Model\Order;
use Magento\Store\Model\Store;
use Nosto\Model\Order\Buyer;
use Nosto\Model\Order\Order as NostoOrder;
use Nosto\Operation\Order\OrderCreate as NostoOrderCreate;
use Nosto\Operation\Order\OrderStatus as NostoOrderUpdate;
Expand Down Expand Up @@ -256,7 +255,6 @@ private function sendNewOrder(Order $order, AccountInterface $nostoAccount, Stor
$nostoCustomerIdentifier = NostoOrderCreate::IDENTIFIER_BY_REF;
}
$nostoOrder = $this->nostoOrderBuilder->build($order);
$nostoOrder->setCustomer(new Buyer()); // Remove customer data from order API calls
if ($nostoCustomerId !== null) {
try {
$orderService = new NostoOrderCreate(
Expand Down
4 changes: 2 additions & 2 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.5.0",
"version": "7.5.1",
"require-dev": {
"phpmd/phpmd": "^2.5",
"sebastian/phpcpd": "*",
Expand Down Expand Up @@ -41,7 +41,7 @@
"php": ">=7.4.0",
"magento/framework": ">=101.0.6|~104.0",
"ext-json": "*",
"nosto/php-sdk": "^7.3",
"nosto/php-sdk": "^7.4",
"laminas/laminas-uri": "*"
},
"repositories": [
Expand Down
Loading

0 comments on commit 782db1b

Please sign in to comment.