Skip to content
This repository has been archived by the owner on Apr 26, 2022. It is now read-only.

Commit

Permalink
Merge branch 'develop' into release/3.11.1
Browse files Browse the repository at this point in the history
# Conflicts:
#	CHANGELOG.md
  • Loading branch information
olsi-qose committed Jun 11, 2019
2 parents 682fc39 + 8df6f52 commit 7b3173d
Show file tree
Hide file tree
Showing 7 changed files with 216 additions and 138 deletions.
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Bug report
about: Report errors and problems
title: ''
labels: bug
assignees: ''

---

**Magento version(s) used**: x.y.z
**Extension version(s) affected**: x.y.z

**Description**
<!-- A clear and concise description of the problem. -->

**How to reproduce**
<!-- Code, config and/or steps needed to reproduce the problem. -->

**Possible Solution**
<!--- Optional: only if you have suggestions on a fix/reason for the bug -->

**Additional context**
<!-- Optional: any other context about the problem: log messages, screenshots, etc. -->
12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE/documentation-issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: Documentation Issue
about: Missing, misleading or incomplete documentation issues
title: ''
labels: docs
assignees: ''

---

**Documentation issue**
<!-- Before opening a new issue, please make sure you already checked -->
<!-- our exhaustive wiki documentation at https://github.com/nosto/nosto-magento/wiki -->
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Ideas for new features and improvements
title: ''
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file. This projec
### 3.11.0
* Use mock products in category personalisation when preview mode is enabled
* Ignore non-numeric product ids in Graphql responses
* Add inventory level to SKU

### 3.10.0
* Add Nosto category personalization in the default Magento category sorting options
Expand Down
30 changes: 30 additions & 0 deletions app/code/community/Nosto/Tagging/Model/Meta/Sku.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ public function loadData(
Mage_Core_Model_Store $store = null
)
{
/** @var Nosto_Tagging_Helper_Data $dataHelper */
$dataHelper = Mage::helper('nosto_tagging');

if ($store === null) {
/** @var Nosto_Tagging_Helper_Data $helper */
$helper = Mage::helper('nosto_tagging');
Expand Down Expand Up @@ -83,6 +86,10 @@ public function loadData(
$this->loadCustomFieldsFromConfigurableAttributes($sku, $parent, $store);
$this->loadCustomFieldsFromAttributeSet($sku, $store);

if ($dataHelper->getUseInventoryLevel($store)) {
$this->amendInventoryLevel($sku);
}

return true;
}

Expand Down Expand Up @@ -173,4 +180,27 @@ protected function buildAvailability(Mage_Catalog_Model_Product $product)

return $availability;
}

/**
* Adds the stock level / inventory level for SKU
*
* @param Mage_Catalog_Model_Product $sku the product sku model.
*
*/
protected function amendInventoryLevel(Mage_Catalog_Model_Product $sku)
{
/* @var Nosto_Tagging_Helper_Stock $stockHelper */
$stockHelper = Mage::helper('nosto_tagging/stock');
try {
$this->setInventoryLevel($stockHelper->getQty($sku));
} catch (\Exception $e) {
Nosto_Tagging_Helper_Log::error(
'Failed to resolve inventory level for SKU %d to tags. Error message was: %s',
array(
$sku->getId(),
$e->getMessage()
)
);
}
}
}
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"require": {
"php": ">=5.4.0",
"nosto/php-sdk": "3.13.0"
"nosto/php-sdk": "3.15.0"
},
"require-dev": {
"php": ">=7.1.0",
Expand All @@ -37,7 +37,8 @@
"magento/marketplace-eqp": "1.*",
"openmage/magento-mirror": "1.9",
"wimg/php-compatibility": "^8.0",
"mridang/pearify": "0.3"
"mridang/pearify": "0.3",
"vlucas/phpdotenv": ">=2.4.0 <3.0"
},
"scripts": {
"post-install-cmd": "if ! type \"composer\" > /dev/null; then echo \"composer not available in path - you must update the lib files manually\"; else composer dump-autoload --optimize; ./vendor/bin/pearify process .;fi",
Expand Down
Loading

0 comments on commit 7b3173d

Please sign in to comment.