Skip to content

Commit

Permalink
Merge pull request #358 from Nosto/release/4.3.0
Browse files Browse the repository at this point in the history
Release/4.3.0
  • Loading branch information
supercid authored Jun 25, 2024
2 parents 4ceca0f + 047e82f commit 033bab0
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 17 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
All notable changes to this project will be documented in this file.
This project adheres to Semantic Versioning(http://semver.org/).

## 4.3.0
- Add parent category id's to tagging

## 4.2.2
-Fix issue that would cause quantity based promotions to be applied to certain customer price groups
- Fix issue that would cause quantity based promotions to be applied to certain customer price groups

## 4.2.1
- Fix a bug where the product categories would not be rendered correctly in the product tagging
Expand Down
15 changes: 15 additions & 0 deletions classes/models/NostoProduct.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public static function loadData(Product $product)
$nostoProduct->setAvailability(self::checkAvailability($product));
$nostoProduct->amendTags($product);
$nostoProduct->amendCategories($product);
$nostoProduct->amendParentCategories($product);
$nostoProduct->setDescription($product->description_short . $product->description);
$nostoProduct->setInventoryLevel((int)$product->quantity);
$nostoProduct->amendBrand($product);
Expand Down Expand Up @@ -355,6 +356,20 @@ protected function amendCategories(Product $product)
}
}

/**
* Fetches the parent category id's
*
* @param Product $product the product model.
*/
protected function amendParentCategories(Product $product)
{
$parentCategories = [];
foreach ($product->getParentCategories(NostoHelperContext::getLanguageId()) as $parentCategory) {
$parentCategories[] = $parentCategory['id_parent'];
}
$this->setParentCategoryIds(array_values(array_unique($parentCategories)));
}

/**
* Builds the brand name from the product's manufacturer to and returns them.
*
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"AFL-3.0"
],
"require": {
"nosto/php-sdk": "^7.1",
"nosto/php-sdk": "^7.3",
"ext-json": "*"
},
"require-dev": {
Expand Down
28 changes: 14 additions & 14 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion nostotagging.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class NostoTagging extends Module
*
* @var string
*/
const PLUGIN_VERSION = '4.2.2';
const PLUGIN_VERSION = '4.3.0';

/**
* Internal name of the Nosto plug-in
Expand Down

0 comments on commit 033bab0

Please sign in to comment.