Skip to content

Commit

Permalink
Fix widget error when showing disabled products
Browse files Browse the repository at this point in the history
Fixes #2
  • Loading branch information
Tam committed Dec 4, 2019
1 parent 154744c commit 05c5457
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 1.1.3 - 2019-12-04
### Fixed
- Fix widget error when showing disabled products (Fixes #2)
- Fix plugin handle format

## 1.1.2 - 2019-10-24
### Fixed
- Fix error with prefixed databases (via [@jmauzyk](https://github.com/jmauzyk))
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ether/purchase-patterns",
"description": "Easily keep track of and show products customers bought together. Plus, sorting by individual and order sales.",
"version": "1.1.2",
"version": "1.1.3",
"type": "craft-plugin",
"license": "proprietary",
"minimum-stability": "dev",
Expand All @@ -19,7 +19,7 @@
"email": "[email protected]"
},
"extra": {
"handle": "purchasePatterns",
"handle": "purchase-patterns",
"name": "Purchase Patterns",
"developer": "Ether Creative",
"developerUrl": "https://ethercreative.co.uk",
Expand Down
4 changes: 2 additions & 2 deletions src/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ public function getTopBoughtTogether ()
$productIds[] = $idB;
}

$products = Product::find()->id($productIds)->all();
$products = Product::find()->id($productIds)->anyStatus()->all();
$productsById = [];

foreach ($products as $product)
Expand Down Expand Up @@ -299,7 +299,7 @@ public function getBoughtTogetherMeta (Product $product)
$countByProductId[$id] += $result['purchase_count'];
}

$products = Product::find()->id($productIds)->fixedOrder(true)->all();
$products = Product::find()->id($productIds)->anyStatus()->fixedOrder(true)->all();

return array_map(function (Product $product) use ($countByProductId) {
return [
Expand Down

0 comments on commit 05c5457

Please sign in to comment.