From 05210b1409f7e17f2c009ece8ae728935e875011 Mon Sep 17 00:00:00 2001 From: Dair Baidauletov Date: Thu, 9 Feb 2023 15:47:05 +0200 Subject: [PATCH 01/20] Implement category export --- Controller/Export/Category.php | 99 ++++++++ Model/Category/Builder.php | 43 +++- Model/Category/CollectionBuilder.php | 148 ++++++++++++ .../Magento/Category/Collection.php | 45 ++++ .../Magento/Category/CollectionBuilder.php | 212 ++++++++++++++++++ 5 files changed, 536 insertions(+), 11 deletions(-) create mode 100644 Controller/Export/Category.php create mode 100644 Model/Category/CollectionBuilder.php create mode 100644 Model/ResourceModel/Magento/Category/Collection.php create mode 100644 Model/ResourceModel/Magento/Category/CollectionBuilder.php diff --git a/Controller/Export/Category.php b/Controller/Export/Category.php new file mode 100644 index 000000000..da2e912f2 --- /dev/null +++ b/Controller/Export/Category.php @@ -0,0 +1,99 @@ + + * @copyright 2020 Nosto Solutions Ltd + * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause + * + */ + +namespace Nosto\Tagging\Controller\Export; + +use Magento\Framework\App\Action\Context; +use Magento\Store\Model\Store; +use Nosto\Model\AbstractCollection; +use Nosto\Model\CategoryCollection; +use Nosto\NostoException; +use Nosto\Tagging\Helper\Account as NostoHelperAccount; +use Nosto\Tagging\Helper\Scope as NostoHelperScope; +use Nosto\Tagging\Model\Category\CollectionBuilder; + +/** + * Category export controller used to export category tree to Nosto. + * This controller will be called by Nosto when a new account has been created + * from the Magento backend. The controller is public, but the information is + * encrypted with AES, and only Nosto can decrypt it. + */ +class Category extends Base +{ + public const PARAM_PREVIEW = 'preview'; + + /** @var CollectionBuilder */ + private CollectionBuilder $nostoCollectionBuilder; + + /** + * @param Context $context + * @param NostoHelperScope $nostoHelperScope + * @param NostoHelperAccount $nostoHelperAccount + * @param CollectionBuilder $collectionBuilder + */ + public function __construct( + Context $context, + NostoHelperScope $nostoHelperScope, + NostoHelperAccount $nostoHelperAccount, + CollectionBuilder $collectionBuilder + ) { + parent::__construct($context, $nostoHelperScope, $nostoHelperAccount); + $this->nostoCollectionBuilder = $collectionBuilder; + } + + /** + * @param Store $store + * @param int $limit + * @param int $offset + * @return AbstractCollection|ProductCollection + * @throws NostoException + */ + public function buildExportCollection(Store $store, int $limit = 100, int $offset = 0) + { + return $this->nostoCollectionBuilder->buildMany($store, $limit, $offset); + } + + /** + * @param Store $store + * @param $id + * @return AbstractCollection|ProductCollection + * @throws NostoException + */ + public function buildSingleExportCollection(Store $store, $id) + { + return $this->nostoCollectionBuilder->buildSingle($store, $id); + } +} diff --git a/Model/Category/Builder.php b/Model/Category/Builder.php index 435166884..f649273f6 100644 --- a/Model/Category/Builder.php +++ b/Model/Category/Builder.php @@ -37,6 +37,7 @@ namespace Nosto\Tagging\Model\Category; use Exception; +use Magento\Catalog\Api\CategoryRepositoryInterface; use Magento\Catalog\Model\Category; use Magento\Framework\Event\ManagerInterface; use Magento\Store\Model\Store; @@ -46,24 +47,35 @@ class Builder { - private NostoLogger $logger; + /** @var CategoryRepositoryInterface */ + private CategoryRepositoryInterface $categoryRepository; + + /** @var ManagerInterface */ private ManagerInterface $eventManager; + + /** @var NostoCategoryService */ private NostoCategoryService $nostoCategoryService; + /** @var NostoLogger */ + private NostoLogger $logger; + /** * Builder constructor. - * @param NostoLogger $logger + * @param CategoryRepositoryInterface $categoryRepository * @param ManagerInterface $eventManager * @param NostoCategoryService $nostoCategoryService + * @param NostoLogger $logger */ public function __construct( - NostoLogger $logger, + CategoryRepositoryInterface $categoryRepository, ManagerInterface $eventManager, - NostoCategoryService $nostoCategoryService + NostoCategoryService $nostoCategoryService, + NostoLogger $logger ) { - $this->logger = $logger; + $this->categoryRepository = $categoryRepository; $this->eventManager = $eventManager; $this->nostoCategoryService = $nostoCategoryService; + $this->logger = $logger; } /** @@ -77,14 +89,11 @@ public function build(Category $category, Store $store) try { $nostoCategory->setId($category->getId()); $nostoCategory->setParentId($category->getParentId()); - $nostoCategory->setImageUrl($category->getImageUrl()); - $nostoCategory->setLevel($category->getLevel()); - $nostoCategory->setUrl($category->getUrl()); - $nostoCategory->setVisibleInMenu($this->getCategoryVisibleInMenu($category)); - $nostoCategory->setCategoryString( + $nostoCategory->setTitle($this->getCategoryNameById($category->getId(), $store->getId())); + $nostoCategory->setPath( $this->nostoCategoryService->getCategory($category, $store) ); - $nostoCategory->setName($category->getName()); + $nostoCategory->setUrl($category->getUrl()); } catch (Exception $e) { $this->logger->exception($e); } @@ -100,6 +109,18 @@ public function build(Category $category, Store $store) return $nostoCategory; } + /** + * @param int $id + * @param null $storeId + * @return string + * @throws \Magento\Framework\Exception\NoSuchEntityException + */ + private function getCategoryNameById($id, $storeId = null) + { + $categoryInstance = $this->categoryRepository->get($id, $storeId); + return $categoryInstance->getName(); + } + /** * @param Category $category * @return bool diff --git a/Model/Category/CollectionBuilder.php b/Model/Category/CollectionBuilder.php new file mode 100644 index 000000000..c408fee7b --- /dev/null +++ b/Model/Category/CollectionBuilder.php @@ -0,0 +1,148 @@ + + * @copyright 2020 Nosto Solutions Ltd + * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause + * + */ + +namespace Nosto\Tagging\Model\Category; + +use Exception; +use Magento\Catalog\Model\Category; +use Magento\Store\Model\Store; +use Nosto\NostoException; +use Nosto\Model\Category\CategoryCollection as NostoCategoryCollection; +use Nosto\Tagging\Logger\Logger as NostoLogger; +use Magento\Catalog\Model\ResourceModel\Category\Collection as MagentoCategoryCollection; +use Nosto\Tagging\Model\Category\Builder as NostoCategoryBuilder; +use Nosto\Tagging\Model\ResourceModel\Magento\Category\CollectionBuilder as CategoryCollectionBuilder; +use Nosto\Tagging\Model\Service\Product\Category\CategoryServiceInterface; +use Traversable; + +/** + * A builder class for building collection containing Nosto categories + */ +class CollectionBuilder +{ + /** @var NostoCategoryBuilder */ + private NostoCategoryBuilder $categoryBuilder; + + /** @var CategoryCollectionBuilder */ + private CategoryCollectionBuilder $categoryCollectionBuilder; + + /** @var CategoryServiceInterface */ + private CategoryServiceInterface $categoryService; + + /** @var NostoLogger */ + private NostoLogger $logger; + + /** + * Collection constructor. + * @param NostoCategoryBuilder $categoryBuilder + * @param CategoryCollectionBuilder $categoryCollectionBuilder + * @param CategoryServiceInterface $categoryService + * @param NostoLogger $logger + */ + public function __construct( + NostoCategoryBuilder $categoryBuilder, + CategoryCollectionBuilder $categoryCollectionBuilder, + CategoryServiceInterface $categoryService, + NostoLogger $logger + ) { + $this->categoryBuilder = $categoryBuilder; + $this->categoryCollectionBuilder = $categoryCollectionBuilder; + $this->categoryService = $categoryService; + $this->logger = $logger; + } + + /** + * @param Store $store + * @param $id + * @return NostoCategoryCollection + * @throws NostoException + */ + public function buildSingle(Store $store, $id) + { + return $this->load( + $store, + $this->categoryCollectionBuilder->buildSingle($store, $id) + ); + } + + /** + * @param Store $store + * @param int $limit + * @param int $offset + * @return NostoCategoryCollection + * @throws NostoException + */ + public function buildMany(Store $store, int $limit = 100, int $offset = 0) + { + return $this->load( + $store, + $this->categoryCollectionBuilder->buildMany($store, $limit, $offset) + ); + } + + /** + * @param Store $store + * @param $collection + * @return NostoCategoryCollection + * @throws NostoException + */ + private function load(Store $store, $collection) + { + /** @var MagentoCategoryCollection $collection */ + $categories = new NostoCategoryCollection(); + $items = $collection->load(); + if ($items instanceof Traversable === false && !is_array($items)) { + throw new NostoException( + sprintf('Invalid collection type %s for category export', get_class($collection)) + ); + } + foreach ($items as $category) { + /** @var Category $category */ + try { + $nostoCategory = $this->categoryBuilder->build( + $category, + $store + ); + if ($nostoCategory !== null) { + $categories->append($nostoCategory); + } + } catch (Exception $e) { + $this->logger->exception($e); + } + } + return $categories; + } +} diff --git a/Model/ResourceModel/Magento/Category/Collection.php b/Model/ResourceModel/Magento/Category/Collection.php new file mode 100644 index 000000000..913f15acd --- /dev/null +++ b/Model/ResourceModel/Magento/Category/Collection.php @@ -0,0 +1,45 @@ + + * @copyright 2020 Nosto Solutions Ltd + * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause + * + */ + +namespace Nosto\Tagging\Model\ResourceModel\Magento\Category; + +use Magento\Catalog\Model\Category\Attribute; +use Magento\Catalog\Model\ResourceModel\Category\Collection as MagentoCategoryCollection; + +class Collection extends MagentoCategoryCollection +{ + +} diff --git a/Model/ResourceModel/Magento/Category/CollectionBuilder.php b/Model/ResourceModel/Magento/Category/CollectionBuilder.php new file mode 100644 index 000000000..eb9f89f81 --- /dev/null +++ b/Model/ResourceModel/Magento/Category/CollectionBuilder.php @@ -0,0 +1,212 @@ + + * @copyright 2020 Nosto Solutions Ltd + * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause + * + */ + +namespace Nosto\Tagging\Model\ResourceModel\Magento\Category; + +use Magento\Catalog\Model\Category\Visibility as CategoryVisibility; +use Magento\Sales\Api\Data\EntityInterface; +use Magento\Store\Model\Store; +use Magento\Catalog\Model\ResourceModel\Category\Collection as CategoryCollection; +use Zend_Db_Select; + +/** + * A builder class for building product collection with the most common filters + */ +class CollectionBuilder +{ + /** @var CategoryCollection */ + private CategoryCollection $categoryCollection; + + /** + * Collection constructor. + * @param CategoryCollection $categoryCollection, + */ + public function __construct( + CategoryCollection $categoryCollection + ) { + $this->categoryCollection = $categoryCollection; + } + + /** + * @return Collection + */ + public function build() + { + return $this->categoryCollection; + } + + /** + * Sets the store filter + * + * @param Store $store + * @return $this + */ + public function withStore(Store $store) + { + $this->categoryCollection->setProductStoreId($store); + $this->categoryCollection->setStore($store); + return $this; + } + + /** + * Defines all attributes to be included into the collection items + * + * @return $this + */ + public function withAllAttributes() + { + $this->categoryCollection->addAttributeToSelect('*'); + return $this; + } + + /** + * Sets filter for only given product ids + * + * @param array $ids + * @return $this + */ + public function withIds(array $ids) + { + $this->categoryCollection->addIdFilter($ids); + return $this; + } + + /** + * Sets the sort for the collection + * + * @param string $field + * @param string $sortOrder + * @return $this + */ + public function setSort(string $field, string $sortOrder) + { + $this->categoryCollection->setOrder($field, $sortOrder); + return $this; + } + + /** + * Sets the page size + * + * @param $pageSize + * @return $this + */ + public function setPageSize($pageSize) + { + $this->categoryCollection->setPageSize($pageSize); + return $this; + } + + /** + * Sets the current page + * + * @param $currentPage + * @return $this + */ + public function setCurrentPage($currentPage) + { + $this->categoryCollection->setCurPage($currentPage); + return $this; + } + + /** + * Resets the data and filters in collection + * @return $this + */ + public function reset() + { + return $this->init(); + } + + /** + * Initializes the collection + * + * @return $this + */ + public function init() + { + $this->categoryCollection->clear()->getSelect()->reset(Zend_Db_Select::WHERE); + return $this; + } + + /** + * Initializes the collection with store filter and defaults + * + * @param Store $store + * @return CollectionBuilder + */ + public function initDefault(Store $store) + { + /** @var CategoryCollection $collection */ + return $this + ->reset() + ->withStore($store) + ->setSort(EntityInterface::CREATED_AT, $this->categoryCollection::SORT_ORDER_DESC); + } + + /** + * Builds and returns the collection with single item (if found) + * + * @param Store $store + * @param $id + * @return Collection + */ + public function buildSingle(Store $store, $id) + { + return $this + ->initDefault($store) + ->withIds([$id]) + ->build(); + } + + /** + * Builds collection with default visibility filter and given limit + * and offset. + * + * @param Store $store + * @param int $limit + * @param int $offset + * @return Collection + */ + public function buildMany(Store $store, int $limit = 100, int $offset = 0) + { + $currentPage = ($offset / $limit) + 1; + return $this + ->initDefault($store) + ->setPageSize($limit) + ->setCurrentPage($currentPage) + ->build(); + } +} From 980a89f82b2467a0837fb1d99f2d181513f983dc Mon Sep 17 00:00:00 2001 From: Dair Baidauletov Date: Fri, 10 Feb 2023 12:52:39 +0200 Subject: [PATCH 02/20] Fix category tagging --- Block/Category.php | 4 +--- Block/Product.php | 13 ------------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/Block/Category.php b/Block/Category.php index dac638abb..22e24da95 100644 --- a/Block/Category.php +++ b/Block/Category.php @@ -124,8 +124,6 @@ private function getNostoCategory() */ public function getAbstractObject() { - $category = new NostoCategory(); - $category->setCategoryString($this->getNostoCategory()); - return $category; + return $this->getNostoCategory(); } } diff --git a/Block/Product.php b/Block/Product.php index 7224344d4..5eb3d8a81 100644 --- a/Block/Product.php +++ b/Block/Product.php @@ -142,19 +142,6 @@ public function getAbstractObject() ); } - /** - * Returns the Nosto category DTO. - * - * @return string|null the current category as a slash-delimited string - */ - public function getNostoCategory() - { - /** @phan-suppress-next-line PhanDeprecatedFunction */ - $category = $this->_coreRegistry->registry('current_category'); - $store = $this->nostoHelperScope->getStore(); - return $category !== null ? $this->categoryBuilder->build($category, $store) : null; - } - /** * Formats a price e.g. "1234.56". * From e8f5e374b6350ca57bc4dcd1dd58db6842512e47 Mon Sep 17 00:00:00 2001 From: Dair Baidauletov Date: Fri, 10 Feb 2023 14:51:50 +0200 Subject: [PATCH 03/20] Remove reference to the old CategoryCollection --- Controller/Export/Category.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Controller/Export/Category.php b/Controller/Export/Category.php index da2e912f2..12603a246 100644 --- a/Controller/Export/Category.php +++ b/Controller/Export/Category.php @@ -39,7 +39,7 @@ use Magento\Framework\App\Action\Context; use Magento\Store\Model\Store; use Nosto\Model\AbstractCollection; -use Nosto\Model\CategoryCollection; +use Nosto\Model\Category\CategoryCollection; use Nosto\NostoException; use Nosto\Tagging\Helper\Account as NostoHelperAccount; use Nosto\Tagging\Helper\Scope as NostoHelperScope; @@ -78,7 +78,7 @@ public function __construct( * @param Store $store * @param int $limit * @param int $offset - * @return AbstractCollection|ProductCollection + * @return AbstractCollection|CategoryCollection * @throws NostoException */ public function buildExportCollection(Store $store, int $limit = 100, int $offset = 0) @@ -89,7 +89,7 @@ public function buildExportCollection(Store $store, int $limit = 100, int $offse /** * @param Store $store * @param $id - * @return AbstractCollection|ProductCollection + * @return AbstractCollection|CategoryCollection * @throws NostoException */ public function buildSingleExportCollection(Store $store, $id) From 6460c7cd4141c47104cc2f0e1da5176244b5b38b Mon Sep 17 00:00:00 2001 From: Dair Baidauletov Date: Mon, 13 Feb 2023 14:48:24 +0200 Subject: [PATCH 04/20] Update Category model path --- Block/Category.php | 2 +- Model/Category/Builder.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Block/Category.php b/Block/Category.php index 22e24da95..8073c756c 100644 --- a/Block/Category.php +++ b/Block/Category.php @@ -39,7 +39,7 @@ use Magento\Framework\Registry; use Magento\Framework\View\Element\Template; use Magento\Framework\View\Element\Template\Context; -use Nosto\Model\Category as NostoCategory; +use Nosto\Model\Category\Category as NostoCategory; use Nosto\Tagging\Helper\Account as NostoHelperAccount; use Nosto\Tagging\Helper\Scope as NostoHelperScope; use Nosto\Tagging\Model\Category\Builder as NostoCategoryBuilder; diff --git a/Model/Category/Builder.php b/Model/Category/Builder.php index f649273f6..f1f4f3c56 100644 --- a/Model/Category/Builder.php +++ b/Model/Category/Builder.php @@ -41,7 +41,7 @@ use Magento\Catalog\Model\Category; use Magento\Framework\Event\ManagerInterface; use Magento\Store\Model\Store; -use Nosto\Model\Category as NostoCategory; +use Nosto\Model\Category\Category as NostoCategory; use Nosto\Tagging\Logger\Logger as NostoLogger; use Nosto\Tagging\Model\Service\Product\Category\CategoryServiceInterface as NostoCategoryService; From da4e05a711fd206be76aa4ed3dfaaf8ffe6b3885 Mon Sep 17 00:00:00 2001 From: Dair Baidauletov Date: Tue, 21 Feb 2023 14:16:49 +0200 Subject: [PATCH 05/20] Update nosto/php-sdk to version 7.0.0 --- composer.json | 2 +- composer.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index f3c5842e5..6d34f9303 100644 --- a/composer.json +++ b/composer.json @@ -42,7 +42,7 @@ "php": ">=7.4.0", "magento/framework": ">=101.0.6|~104.0", "ext-json": "*", - "nosto/php-sdk": "^6.2" + "nosto/php-sdk": "^7.0" }, "repositories": [ { diff --git a/composer.lock b/composer.lock index cb0e7af8e..6e3c29def 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "d15d11227ee293493e8cf27761ec54c8", + "content-hash": "c0bcfb37628d016682a849f6b51eaa2b", "packages": [ { "name": "brick/math", @@ -2870,16 +2870,16 @@ }, { "name": "nosto/php-sdk", - "version": "6.2.0", + "version": "7.0.0", "source": { "type": "git", "url": "https://github.com/Nosto/nosto-php-sdk.git", - "reference": "a9f7588367f3e1fdaae57c946ceaa362d8d305d5" + "reference": "0b978cae3cc5bdc783562518dd7d4b4a5138b4b3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Nosto/nosto-php-sdk/zipball/a9f7588367f3e1fdaae57c946ceaa362d8d305d5", - "reference": "a9f7588367f3e1fdaae57c946ceaa362d8d305d5", + "url": "https://api.github.com/repos/Nosto/nosto-php-sdk/zipball/0b978cae3cc5bdc783562518dd7d4b4a5138b4b3", + "reference": "0b978cae3cc5bdc783562518dd7d4b4a5138b4b3", "shasum": "" }, "require": { @@ -2920,9 +2920,9 @@ "description": "PHP SDK for developing Nosto modules for e-commerce platforms", "support": { "issues": "https://github.com/Nosto/nosto-php-sdk/issues", - "source": "https://github.com/Nosto/nosto-php-sdk/tree/6.2.0" + "source": "https://github.com/Nosto/nosto-php-sdk/tree/7.0.0" }, - "time": "2023-01-05T08:40:01+00:00" + "time": "2023-02-21T11:40:47+00:00" }, { "name": "paragonie/constant_time_encoding", From 4712f988fa840c6cd61c3300a87070a1f77d75cf Mon Sep 17 00:00:00 2001 From: Dair Baidauletov Date: Thu, 2 Mar 2023 13:31:35 +0200 Subject: [PATCH 06/20] Create category save observer --- Observer/Category/Update.php | 148 +++++++++++++++++++++++++++++++++++ etc/events.xml | 3 + 2 files changed, 151 insertions(+) create mode 100644 Observer/Category/Update.php diff --git a/Observer/Category/Update.php b/Observer/Category/Update.php new file mode 100644 index 000000000..43b3ead85 --- /dev/null +++ b/Observer/Category/Update.php @@ -0,0 +1,148 @@ + + * @copyright 2020 Nosto Solutions Ltd + * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause + * + */ + +namespace Nosto\Tagging\Observer\Category; + +use Exception; +use Magento\Catalog\Model\Category; +use Magento\Framework\Event\Observer; +use Magento\Framework\Event\ObserverInterface; +use Magento\Framework\Module\Manager as ModuleManager; +use Magento\Store\Model\Store; +use Nosto\Operation\Category\CategoryUpdate as NostoCategoryUpdate; +use Nosto\Request\Http\HttpRequest; +use Nosto\Tagging\Helper\Account as NostoHelperAccount; +use Nosto\Tagging\Helper\Data as NostoHelperData; +use Nosto\Tagging\Helper\Url as NostoHelperUrl; +use Nosto\Tagging\Logger\Logger as NostoLogger; +use Nosto\Tagging\Model\Category\Builder as NostoCategoryBuilder; +use Nosto\Types\Signup\AccountInterface; + +class Update implements ObserverInterface +{ + private NostoHelperData $nostoHelperData; + private NostoHelperAccount $nostoHelperAccount; + private NostoCategoryBuilder $nostoCategoryBuilder; + private NostoLogger $logger; + private ModuleManager $moduleManager; + private NostoHelperUrl $nostoHelperUrl; + + /** + * Save constructor. + * @param NostoHelperData $nostoHelperData + * @param NostoHelperAccount $nostoHelperAccount + * @param NostoCategoryBuilder $nostoCategoryBuilder + * @param NostoLogger $logger + * @param ModuleManager $moduleManager + * @param NostoHelperUrl $nostoHelperUrl + */ + public function __construct( + NostoHelperData $nostoHelperData, + NostoHelperAccount $nostoHelperAccount, + NostoCategoryBuilder $nostoCategoryBuilder, + NostoLogger $logger, + ModuleManager $moduleManager, + NostoHelperUrl $nostoHelperUrl + ) { + $this->nostoHelperData = $nostoHelperData; + $this->nostoHelperAccount = $nostoHelperAccount; + $this->nostoCategoryBuilder = $nostoCategoryBuilder; + $this->logger = $logger; + $this->moduleManager = $moduleManager; + $this->nostoHelperUrl = $nostoHelperUrl; + } + + /** + * Event handler for the "catalog_category_save_after" and event. + * Sends a category update API call to Nosto. + * + * @param Observer $observer + * @return void + * @suppress PhanDeprecatedFunction + * @suppress PhanTypeMismatchArgument + */ + public function execute(Observer $observer) + { + if ($this->moduleManager->isEnabled(NostoHelperData::MODULE_NAME)) { + HttpRequest::buildUserAgent( + 'Magento', + $this->nostoHelperData->getPlatformVersion(), + $this->nostoHelperData->getModuleVersion() + ); + + /* @var Category $category */ + /** @noinspection PhpUndefinedMethodInspection */ + $category = $observer->getCategory(); + + $store = $category->getStore(); + $nostoAccount = $this->nostoHelperAccount->findAccount( + $store + ); + if ($nostoAccount !== null) { + $this->updateCategory($category, $nostoAccount, $store); + } + } + } + + /** + * Send a category update to Nosto + * + * @param Category $category + * @param AccountInterface $nostoAccount + * @param Store $store + */ + private function updateCategory(Category $category, AccountInterface $nostoAccount, Store $store) + { + $nostoCategory = $this->nostoCategoryBuilder->build($category, $store); + try { + $categoryService = new NostoCategoryUpdate( + $nostoCategory, + $nostoAccount, + $this->nostoHelperUrl->getActiveDomain($store) + ); + $categoryService->execute(); + } catch (Exception $e) { + $this->logger->error( + sprintf( + 'Failed to update categoeries with id %s. + Message was: %s', + $category->getId(), + $e->getMessage() + ) + ); + } + } +} diff --git a/etc/events.xml b/etc/events.xml index 79d76cdfe..ef27a780e 100644 --- a/etc/events.xml +++ b/etc/events.xml @@ -55,6 +55,9 @@ + + + From f5a14162c424403cc2320a79d5cf9882b261c99e Mon Sep 17 00:00:00 2001 From: Cid Lopes Date: Mon, 29 May 2023 15:14:56 +0300 Subject: [PATCH 07/20] Fix return type category --- Block/Category.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Block/Category.php b/Block/Category.php index 8073c756c..d7a294557 100644 --- a/Block/Category.php +++ b/Block/Category.php @@ -104,7 +104,7 @@ public function __construct( /** * Returns the current category as a slash delimited string * - * @return string|null the current category as a slash delimited string + * @return NostoCategory|null the current category as a slash delimited string */ private function getNostoCategory() { @@ -120,7 +120,7 @@ private function getNostoCategory() /** * Returns the HTML to render categories * - * @return NostoCategory + * @return NostoCategory|null */ public function getAbstractObject() { From ee7b6362b5ec8b07f6be030a9444fac903ba0cc4 Mon Sep 17 00:00:00 2001 From: Cid Lopes Date: Mon, 29 May 2023 15:29:21 +0300 Subject: [PATCH 08/20] Update php-sdk to 7.0 --- composer.json | 2 +- composer.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 65fb9bcec..ef758b061 100644 --- a/composer.json +++ b/composer.json @@ -41,7 +41,7 @@ "php": ">=7.4.0", "magento/framework": ">=101.0.6|~104.0", "ext-json": "*", - "nosto/php-sdk": "6.2.1" + "nosto/php-sdk": "^7.0" }, "repositories": [ { diff --git a/composer.lock b/composer.lock index fd46d70b8..be7efbd0a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "643facfe144c9d6c100daa8f7c7f57ce", + "content-hash": "fdfe0a8101bae542f39aad114077748e", "packages": [ { "name": "brick/math", From 67d31d30ec648c4c9fe681b436dc54657ad009aa Mon Sep 17 00:00:00 2001 From: Cid Lopes Date: Mon, 29 May 2023 15:31:39 +0300 Subject: [PATCH 09/20] Update php-sdk to 7.0 --- composer.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.lock b/composer.lock index be7efbd0a..a9d229f4c 100644 --- a/composer.lock +++ b/composer.lock @@ -2866,16 +2866,16 @@ }, { "name": "nosto/php-sdk", - "version": "6.2.1", + "version": "7.0.0", "source": { "type": "git", "url": "https://github.com/Nosto/nosto-php-sdk.git", - "reference": "be5aa358c3d3f9f62ce1bedf7210bd13017fc82c" + "reference": "0b978cae3cc5bdc783562518dd7d4b4a5138b4b3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Nosto/nosto-php-sdk/zipball/be5aa358c3d3f9f62ce1bedf7210bd13017fc82c", - "reference": "be5aa358c3d3f9f62ce1bedf7210bd13017fc82c", + "url": "https://api.github.com/repos/Nosto/nosto-php-sdk/zipball/0b978cae3cc5bdc783562518dd7d4b4a5138b4b3", + "reference": "0b978cae3cc5bdc783562518dd7d4b4a5138b4b3", "shasum": "" }, "require": { @@ -2916,9 +2916,9 @@ "description": "PHP SDK for developing Nosto modules for e-commerce platforms", "support": { "issues": "https://github.com/Nosto/nosto-php-sdk/issues", - "source": "https://github.com/Nosto/nosto-php-sdk/tree/6.2.1" + "source": "https://github.com/Nosto/nosto-php-sdk/tree/7.0.0" }, - "time": "2023-04-18T11:38:07+00:00" + "time": "2023-02-21T11:40:47+00:00" }, { "name": "paragonie/constant_time_encoding", From 68c329985c26a6aa63e8dc25c6487312e1d1418e Mon Sep 17 00:00:00 2001 From: Cid Lopes Date: Mon, 29 May 2023 15:36:15 +0300 Subject: [PATCH 10/20] Update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 142f3a24c..e118e362a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ All notable changes to this project will be documented in this file. This project adheres to Semantic Versioning. +### 7.3.0 - UNRELEASED +* Update tagging with category listing support +* Add category export + ### 7.2.4 * Add null check in order observer to allow for orders overriding From 2a01af08d12dcc88ec574aed1c89a84f53d83274 Mon Sep 17 00:00:00 2001 From: Cid Lopes Date: Mon, 29 May 2023 15:41:28 +0300 Subject: [PATCH 11/20] Fix type, remove getCategoryVisibleInMenu --- Model/Category/Builder.php | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/Model/Category/Builder.php b/Model/Category/Builder.php index f1f4f3c56..f8e207a89 100644 --- a/Model/Category/Builder.php +++ b/Model/Category/Builder.php @@ -40,6 +40,7 @@ use Magento\Catalog\Api\CategoryRepositoryInterface; use Magento\Catalog\Model\Category; use Magento\Framework\Event\ManagerInterface; +use Magento\Framework\Exception\NoSuchEntityException; use Magento\Store\Model\Store; use Nosto\Model\Category\Category as NostoCategory; use Nosto\Tagging\Logger\Logger as NostoLogger; @@ -97,7 +98,7 @@ public function build(Category $category, Store $store) } catch (Exception $e) { $this->logger->exception($e); } - if (empty($nostoCategory)) { + if (empty($nostoCategory->getId())) { $nostoCategory = null; } else { $this->eventManager->dispatch( @@ -111,23 +112,12 @@ public function build(Category $category, Store $store) /** * @param int $id - * @param null $storeId + * @param int $storeId * @return string - * @throws \Magento\Framework\Exception\NoSuchEntityException + * @throws NoSuchEntityException */ - private function getCategoryNameById($id, $storeId = null) + private function getCategoryNameById(int $id, int $storeId) { - $categoryInstance = $this->categoryRepository->get($id, $storeId); - return $categoryInstance->getName(); - } - - /** - * @param Category $category - * @return bool - */ - private function getCategoryVisibleInMenu(Category $category) - { - $visibleInMenu = $category->getIncludeInMenu(); - return $visibleInMenu === "1"; + return $this->categoryRepository->get($id, $storeId)->getName(); } } From d39dec143d23a815149fb5b4c380418070baee62 Mon Sep 17 00:00:00 2001 From: Cid Lopes Date: Mon, 29 May 2023 16:35:04 +0300 Subject: [PATCH 12/20] temp sdk-branch --- composer.json | 2 +- composer.lock | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index ef758b061..6558e370f 100644 --- a/composer.json +++ b/composer.json @@ -41,7 +41,7 @@ "php": ">=7.4.0", "magento/framework": ">=101.0.6|~104.0", "ext-json": "*", - "nosto/php-sdk": "^7.0" + "nosto/php-sdk": "dev-release/7.1.0" }, "repositories": [ { diff --git a/composer.lock b/composer.lock index a9d229f4c..bf61e36c3 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "fdfe0a8101bae542f39aad114077748e", + "content-hash": "22e02fc78bdd5bf61196bf1a0dfa50c3", "packages": [ { "name": "brick/math", @@ -2866,16 +2866,16 @@ }, { "name": "nosto/php-sdk", - "version": "7.0.0", + "version": "dev-release/7.1.0", "source": { "type": "git", "url": "https://github.com/Nosto/nosto-php-sdk.git", - "reference": "0b978cae3cc5bdc783562518dd7d4b4a5138b4b3" + "reference": "411aa6ae4ed8f27b74c5238ce41cd8892f816283" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Nosto/nosto-php-sdk/zipball/0b978cae3cc5bdc783562518dd7d4b4a5138b4b3", - "reference": "0b978cae3cc5bdc783562518dd7d4b4a5138b4b3", + "url": "https://api.github.com/repos/Nosto/nosto-php-sdk/zipball/411aa6ae4ed8f27b74c5238ce41cd8892f816283", + "reference": "411aa6ae4ed8f27b74c5238ce41cd8892f816283", "shasum": "" }, "require": { @@ -2916,9 +2916,9 @@ "description": "PHP SDK for developing Nosto modules for e-commerce platforms", "support": { "issues": "https://github.com/Nosto/nosto-php-sdk/issues", - "source": "https://github.com/Nosto/nosto-php-sdk/tree/7.0.0" + "source": "https://github.com/Nosto/nosto-php-sdk/tree/release/7.1.0" }, - "time": "2023-02-21T11:40:47+00:00" + "time": "2023-05-29T13:25:30+00:00" }, { "name": "paragonie/constant_time_encoding", @@ -12255,7 +12255,9 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": { + "nosto/php-sdk": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": { From d84340e488b6d9053eaacbc7e53320539c27b036 Mon Sep 17 00:00:00 2001 From: Cid Lopes Date: Mon, 29 May 2023 16:36:25 +0300 Subject: [PATCH 13/20] Remove unused imports, pass correct id to setProductStoreId --- Model/ResourceModel/Magento/Category/Collection.php | 1 - Model/ResourceModel/Magento/Category/CollectionBuilder.php | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Model/ResourceModel/Magento/Category/Collection.php b/Model/ResourceModel/Magento/Category/Collection.php index 913f15acd..ccf75230a 100644 --- a/Model/ResourceModel/Magento/Category/Collection.php +++ b/Model/ResourceModel/Magento/Category/Collection.php @@ -36,7 +36,6 @@ namespace Nosto\Tagging\Model\ResourceModel\Magento\Category; -use Magento\Catalog\Model\Category\Attribute; use Magento\Catalog\Model\ResourceModel\Category\Collection as MagentoCategoryCollection; class Collection extends MagentoCategoryCollection diff --git a/Model/ResourceModel/Magento/Category/CollectionBuilder.php b/Model/ResourceModel/Magento/Category/CollectionBuilder.php index eb9f89f81..12acc2771 100644 --- a/Model/ResourceModel/Magento/Category/CollectionBuilder.php +++ b/Model/ResourceModel/Magento/Category/CollectionBuilder.php @@ -36,7 +36,6 @@ namespace Nosto\Tagging\Model\ResourceModel\Magento\Category; -use Magento\Catalog\Model\Category\Visibility as CategoryVisibility; use Magento\Sales\Api\Data\EntityInterface; use Magento\Store\Model\Store; use Magento\Catalog\Model\ResourceModel\Category\Collection as CategoryCollection; @@ -61,7 +60,7 @@ public function __construct( } /** - * @return Collection + * @return CategoryCollection */ public function build() { @@ -76,7 +75,7 @@ public function build() */ public function withStore(Store $store) { - $this->categoryCollection->setProductStoreId($store); + $this->categoryCollection->setProductStoreId($store->getId()); $this->categoryCollection->setStore($store); return $this; } From 7b171507b527fb0af84915c7a09019f36c46b3eb Mon Sep 17 00:00:00 2001 From: Cid Lopes Date: Mon, 29 May 2023 16:45:06 +0300 Subject: [PATCH 14/20] Fix return types, add types in CategoryCollectionBuilder --- .../Magento/Category/CollectionBuilder.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Model/ResourceModel/Magento/Category/CollectionBuilder.php b/Model/ResourceModel/Magento/Category/CollectionBuilder.php index 12acc2771..bc670925a 100644 --- a/Model/ResourceModel/Magento/Category/CollectionBuilder.php +++ b/Model/ResourceModel/Magento/Category/CollectionBuilder.php @@ -36,6 +36,7 @@ namespace Nosto\Tagging\Model\ResourceModel\Magento\Category; +use Magento\Framework\Exception\LocalizedException; use Magento\Sales\Api\Data\EntityInterface; use Magento\Store\Model\Store; use Magento\Catalog\Model\ResourceModel\Category\Collection as CategoryCollection; @@ -84,6 +85,7 @@ public function withStore(Store $store) * Defines all attributes to be included into the collection items * * @return $this + * @throws LocalizedException */ public function withAllAttributes() { @@ -119,10 +121,10 @@ public function setSort(string $field, string $sortOrder) /** * Sets the page size * - * @param $pageSize + * @param int $pageSize * @return $this */ - public function setPageSize($pageSize) + public function setPageSize(int $pageSize) { $this->categoryCollection->setPageSize($pageSize); return $this; @@ -131,10 +133,10 @@ public function setPageSize($pageSize) /** * Sets the current page * - * @param $currentPage + * @param int $currentPage * @return $this */ - public function setCurrentPage($currentPage) + public function setCurrentPage(int $currentPage) { $this->categoryCollection->setCurPage($currentPage); return $this; @@ -179,10 +181,10 @@ public function initDefault(Store $store) * Builds and returns the collection with single item (if found) * * @param Store $store - * @param $id - * @return Collection + * @param int $id + * @return CategoryCollection */ - public function buildSingle(Store $store, $id) + public function buildSingle(Store $store, int $id) { return $this ->initDefault($store) @@ -197,7 +199,7 @@ public function buildSingle(Store $store, $id) * @param Store $store * @param int $limit * @param int $offset - * @return Collection + * @return CategoryCollection */ public function buildMany(Store $store, int $limit = 100, int $offset = 0) { From ba44234664664c7a470f55599b0bbacc10d1fddb Mon Sep 17 00:00:00 2001 From: Cid Lopes Date: Mon, 29 May 2023 16:52:35 +0300 Subject: [PATCH 15/20] Update nosto SDK to 7.1.0 --- composer.json | 2 +- composer.lock | 18 ++++++++---------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/composer.json b/composer.json index 6558e370f..1d369e29a 100644 --- a/composer.json +++ b/composer.json @@ -41,7 +41,7 @@ "php": ">=7.4.0", "magento/framework": ">=101.0.6|~104.0", "ext-json": "*", - "nosto/php-sdk": "dev-release/7.1.0" + "nosto/php-sdk": "^7.1" }, "repositories": [ { diff --git a/composer.lock b/composer.lock index bf61e36c3..5fb0cde62 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "22e02fc78bdd5bf61196bf1a0dfa50c3", + "content-hash": "8ae4ec567d738ff3eacc4e59391fa2d7", "packages": [ { "name": "brick/math", @@ -2866,16 +2866,16 @@ }, { "name": "nosto/php-sdk", - "version": "dev-release/7.1.0", + "version": "7.1.0", "source": { "type": "git", "url": "https://github.com/Nosto/nosto-php-sdk.git", - "reference": "411aa6ae4ed8f27b74c5238ce41cd8892f816283" + "reference": "7217ae9c10bdf42c80306f6d01a9e122223e7ebf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Nosto/nosto-php-sdk/zipball/411aa6ae4ed8f27b74c5238ce41cd8892f816283", - "reference": "411aa6ae4ed8f27b74c5238ce41cd8892f816283", + "url": "https://api.github.com/repos/Nosto/nosto-php-sdk/zipball/7217ae9c10bdf42c80306f6d01a9e122223e7ebf", + "reference": "7217ae9c10bdf42c80306f6d01a9e122223e7ebf", "shasum": "" }, "require": { @@ -2916,9 +2916,9 @@ "description": "PHP SDK for developing Nosto modules for e-commerce platforms", "support": { "issues": "https://github.com/Nosto/nosto-php-sdk/issues", - "source": "https://github.com/Nosto/nosto-php-sdk/tree/release/7.1.0" + "source": "https://github.com/Nosto/nosto-php-sdk/tree/7.1.0" }, - "time": "2023-05-29T13:25:30+00:00" + "time": "2023-05-29T13:49:33+00:00" }, { "name": "paragonie/constant_time_encoding", @@ -12255,9 +12255,7 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": { - "nosto/php-sdk": 20 - }, + "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { From 58dc139dcc40e81bbb9d9f63b9d2d93eb2dc6445 Mon Sep 17 00:00:00 2001 From: Phong Ly Date: Wed, 14 Jun 2023 09:27:45 +0300 Subject: [PATCH 16/20] Set category availabel for NostoCategory in builder --- Model/Category/Builder.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Model/Category/Builder.php b/Model/Category/Builder.php index f8e207a89..d7d59f265 100644 --- a/Model/Category/Builder.php +++ b/Model/Category/Builder.php @@ -95,6 +95,7 @@ public function build(Category $category, Store $store) $this->nostoCategoryService->getCategory($category, $store) ); $nostoCategory->setUrl($category->getUrl()); + $nostoCategory->setAvailable($category->getIsActive() ?? false); } catch (Exception $e) { $this->logger->exception($e); } From b5b6a1e51203b2262f4a4a13e40302f8ad2d0417 Mon Sep 17 00:00:00 2001 From: Phong Ly Date: Thu, 15 Jun 2023 08:28:36 +0300 Subject: [PATCH 17/20] Add categoryString for NostoCategory in Builder --- Model/Category/Builder.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Model/Category/Builder.php b/Model/Category/Builder.php index d7d59f265..13b34730d 100644 --- a/Model/Category/Builder.php +++ b/Model/Category/Builder.php @@ -91,9 +91,9 @@ public function build(Category $category, Store $store) $nostoCategory->setId($category->getId()); $nostoCategory->setParentId($category->getParentId()); $nostoCategory->setTitle($this->getCategoryNameById($category->getId(), $store->getId())); - $nostoCategory->setPath( - $this->nostoCategoryService->getCategory($category, $store) - ); + $path = $this->nostoCategoryService->getCategory($category, $store); + $nostoCategory->setPath($path); + $nostoCategory->setCategoryString($path); $nostoCategory->setUrl($category->getUrl()); $nostoCategory->setAvailable($category->getIsActive() ?? false); } catch (Exception $e) { From 8de0bfa51ad973875883dac10a3deecf71af4def Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 15 Jun 2023 14:54:54 +0300 Subject: [PATCH 18/20] Use the branch dev-hotfix/fix-update-category Use the right branch from php-sdk for now to prevent PHAN checking being failed. Need to fix before merge --- composer.json | 2 +- composer.lock | 20 +++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/composer.json b/composer.json index 1d369e29a..e50d21d1f 100644 --- a/composer.json +++ b/composer.json @@ -41,7 +41,7 @@ "php": ">=7.4.0", "magento/framework": ">=101.0.6|~104.0", "ext-json": "*", - "nosto/php-sdk": "^7.1" + "nosto/php-sdk": "dev-hotfix/fix-update-category" }, "repositories": [ { diff --git a/composer.lock b/composer.lock index 5fb0cde62..c08646609 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "8ae4ec567d738ff3eacc4e59391fa2d7", + "content-hash": "5d5b24449493c6a2fc300fae27501844", "packages": [ { "name": "brick/math", @@ -2866,16 +2866,16 @@ }, { "name": "nosto/php-sdk", - "version": "7.1.0", + "version": "dev-hotfix/fix-update-category", "source": { "type": "git", "url": "https://github.com/Nosto/nosto-php-sdk.git", - "reference": "7217ae9c10bdf42c80306f6d01a9e122223e7ebf" + "reference": "9a479e74ddd84df77b590d0818e008f99218d1bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Nosto/nosto-php-sdk/zipball/7217ae9c10bdf42c80306f6d01a9e122223e7ebf", - "reference": "7217ae9c10bdf42c80306f6d01a9e122223e7ebf", + "url": "https://api.github.com/repos/Nosto/nosto-php-sdk/zipball/9a479e74ddd84df77b590d0818e008f99218d1bc", + "reference": "9a479e74ddd84df77b590d0818e008f99218d1bc", "shasum": "" }, "require": { @@ -2916,9 +2916,9 @@ "description": "PHP SDK for developing Nosto modules for e-commerce platforms", "support": { "issues": "https://github.com/Nosto/nosto-php-sdk/issues", - "source": "https://github.com/Nosto/nosto-php-sdk/tree/7.1.0" + "source": "https://github.com/Nosto/nosto-php-sdk/tree/hotfix/fix-update-category" }, - "time": "2023-05-29T13:49:33+00:00" + "time": "2023-06-15T08:38:35+00:00" }, { "name": "paragonie/constant_time_encoding", @@ -12255,7 +12255,9 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": { + "nosto/php-sdk": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": { @@ -12263,5 +12265,5 @@ "ext-json": "*" }, "platform-dev": [], - "plugin-api-version": "2.1.0" + "plugin-api-version": "2.2.0" } From 40d536e653d19cc6ecccfcae1f3b4eae11b7fd88 Mon Sep 17 00:00:00 2001 From: Cid Lopes Date: Thu, 24 Aug 2023 08:41:14 +0300 Subject: [PATCH 19/20] Bump version --- composer.json | 2 +- etc/module.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index eaa52fd9e..d7b05b19c 100644 --- a/composer.json +++ b/composer.json @@ -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.2.6", + "version": "7.3.0", "require-dev": { "phpmd/phpmd": "^2.5", "sebastian/phpcpd": "*", diff --git a/etc/module.xml b/etc/module.xml index b56064ecd..44ed5f640 100755 --- a/etc/module.xml +++ b/etc/module.xml @@ -37,5 +37,5 @@ - + From fe2ae5821ecb9268b05937883316ec3377c3ee07 Mon Sep 17 00:00:00 2001 From: Cid Lopes Date: Tue, 29 Aug 2023 09:33:05 +0300 Subject: [PATCH 20/20] remove unused Model/ResourceModel/Magento/Category/Collection --- .../Magento/Category/Collection.php | 44 ------------------- 1 file changed, 44 deletions(-) delete mode 100644 Model/ResourceModel/Magento/Category/Collection.php diff --git a/Model/ResourceModel/Magento/Category/Collection.php b/Model/ResourceModel/Magento/Category/Collection.php deleted file mode 100644 index ccf75230a..000000000 --- a/Model/ResourceModel/Magento/Category/Collection.php +++ /dev/null @@ -1,44 +0,0 @@ - - * @copyright 2020 Nosto Solutions Ltd - * @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause - * - */ - -namespace Nosto\Tagging\Model\ResourceModel\Magento\Category; - -use Magento\Catalog\Model\ResourceModel\Category\Collection as MagentoCategoryCollection; - -class Collection extends MagentoCategoryCollection -{ - -}