Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge beta into master #93

Merged
merged 7 commits into from
Feb 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Model/Write/Products/CollectionDecorator/Children.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class Children implements DecoratorInterface
* @param Helper $helper
* @param DbResourceHelper $dbResource
* @param TweakwiseConfig $config
* @param WebsiteLink $websiteLink
*/
public function __construct(
ProductType $productType,
Expand All @@ -92,7 +93,8 @@ public function __construct(
CollectionFactory $collectionFactory,
Helper $helper,
DbResourceHelper $dbResource,
TweakwiseConfig $config
TweakwiseConfig $config,
private readonly WebsiteLink $websiteLink
) {
$this->productType = $productType;
$this->eavIteratorFactory = $eavIteratorFactory;
Expand All @@ -113,6 +115,7 @@ public function decorate(Collection|StockCollection|PriceCollection $collection)
{
$this->childEntities = $this->collectionFactory->create(['store' => $collection->getStore()]);
$this->createChildEntities($collection);
$this->websiteLink->decorate($this->childEntities);
$this->loadChildAttributes($collection->getStore());
}

Expand Down
2 changes: 1 addition & 1 deletion Model/Write/Products/CompositeExportEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function getEnabledChildren(): array
$this->enabledChildren = [];

foreach ($this->getAllChildren() as $child) {
if ($child->shouldExportByStatus()) {
if ($child->shouldExport()) {
$this->enabledChildren[] = $child;
}
}
Expand Down
1 change: 1 addition & 0 deletions Model/Write/Products/ExportEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ public function addAttribute(string $attribute, $value): void
public function getAttributes(): array
{
$result = [];
$result['item_typeproduct'] = ['attribute' => 'item_type', 'value' => 'product'];
foreach ($this->attributes as $attribute => $values) {
foreach ($values as $value) {
$result[$attribute . $value] = ['attribute' => $attribute, 'value' => $value];
Expand Down
3 changes: 2 additions & 1 deletion Model/Write/Products/ExportEntityChild.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ public function setChildOptions(ChildOptions $childOptions): void
public function shouldExport(): bool
{
return $this->shouldExportByStock()
&& $this->shouldExportByStatus();
&& $this->shouldExportByStatus() &&
$this->shouldExportByWebsite();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<resource>Tweakwise_Magento2TweakwiseExport::config</resource>
<group id="export" translate="label" type="text" sortOrder="1000" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Export</label>
<comment>Tweakwise Export version v7.2.1</comment>
<comment>Tweakwise Export version v7.2.2</comment>
<field id="enabled" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Enabled</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
Expand Down