Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 6d030d0
Merge: 880f478 1c282a3
Author: ah-net <[email protected]>
Date:   Tue Sep 24 14:45:30 2024 +0200

    Merge pull request #75 from EmicoEcommerce/master

    Merge master into beta

commit 880f478
Merge: 2b8525b 07d8073
Author: Tjeu Jansen <[email protected]>
Date:   Fri Aug 30 11:09:50 2024 +0200

    Merge pull request #73 from Hnto/beta

    fix: type case int to boolean since shouldExportByStock only has boolean as return type

commit 07d8073
Author: Herant A. <[email protected]>
Date:   Fri Aug 30 11:08:27 2024 +0200

    fix: type case int to boolean since shouldExportByStock only has boolean as return type

commit 2b8525b
Author: Pieter Zandbergen <[email protected]>
Date:   Tue Jun 18 13:44:19 2024 +0200

    Fix stock behavior for grouped products

    Fixing issue #68 (grouped products should be in stock if at least one child is in stock)

commit 3c250f3
Merge: 69c6ba5 232868c
Author: ah-net <[email protected]>
Date:   Tue Jun 11 09:28:08 2024 +0200

    Merge branch 'master' into beta

commit 69c6ba5
Author: ah-net <[email protected]>
Date:   Tue Jun 4 14:53:19 2024 +0200

    feat: export is salable

commit 15deb66
Author: ah-net <[email protected]>
Date:   Wed May 15 12:46:35 2024 +0200

    fix: use inventory stock table

commit 56a6e71
Merge: e8a836b 97f1fd9
Author: ah-net <[email protected]>
Date:   Wed May 1 10:40:30 2024 +0200

    Merge branch 'master' into beta

commit e8a836b
Author: ah-net <[email protected]>
Date:   Wed May 1 10:39:22 2024 +0200

    chore: fix style (#63)

commit 2ff37cf
Author: evs-xsarus <[email protected]>
Date:   Tue Apr 30 16:19:19 2024 +0200

    Make installable on PHP 8.x (#58)

    * fix: make installable on php 8.x

commit 0d1ce24
Author: ah-net <[email protected]>
Date:   Tue Apr 30 15:59:31 2024 +0200

    fix: magento 2.4.7 compatibility (#61)
  • Loading branch information
ah-net committed Sep 24, 2024
1 parent 1c282a3 commit 1a930c0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Model/Write/Products/ExportEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ protected function shouldExportByVisibility(): bool
*/
protected function isInStock(): bool
{
return $this->getStockItem() !== null ? $this->getStockItem()->getIsInStock() : false;
return $this->getStockItem() !== null ? (bool) $this->getStockItem()->getIsInStock() : false;
}

/**
Expand Down
4 changes: 3 additions & 1 deletion Traits/Stock/HasStockThroughChildren.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Tweakwise\Magento2TweakwiseExport\Model\StockItem;
use Magento\ConfigurableProduct\Model\Product\Type\Configurable;
use Magento\GroupedProduct\Model\Product\Type\Grouped;

/**
* Trait HasChildren
Expand Down Expand Up @@ -40,7 +41,8 @@ public function getStockItem(): ?StockItem
$qty = (int) array_sum($childQty);
$isInStock = min(
max($childStockStatus),
$this->getTypeId() === Configurable::TYPE_CODE ? 1 : $this->stockItem->getIsInStock()
in_array($this->getTypeId(), [Configurable::TYPE_CODE, Grouped::TYPE_CODE], true) ? 1
: $this->stockItem->getIsInStock()
);
$stockItem = new StockItem();
$stockItem->setQty($qty);
Expand Down

0 comments on commit 1a930c0

Please sign in to comment.