Skip to content

Commit c20732c

Browse files
🔃 [Magento Community Engineering] Community Contributions - 2.3-develop
Accepted Community Pull Requests: - #23500: Fixed issue #23383 (by @manishgoswamij) - #22658: Fixed #22545 Status downloadable product stays pending after succesfu� (by @shikhamis11) Fixed GitHub Issues: - #23383: Products which are not assigned to any store are automatically being force-assigned a store ID after being saved (reported by @diamondavocado) has been fixed in #23500 by @manishgoswamij in 2.3-develop branch Related commits: 1. 45e211f 2. 50c051f - #22545: Status downloadable product stays pending after succesfull payment (reported by @KooTjoo) has been fixed in #22658 by @shikhamis11 in 2.3-develop branch Related commits: 1. c4dc289 2. 7174745 3. 630bbb5 4. a800c6b 5. e2f06b3 6. 1524687
2 parents 5396786 + 25981de commit c20732c

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
<element name="sectionHeader" type="button" selector="div[data-index='websites']" timeout="30"/>
8080
<element name="sectionHeaderOpened" type="button" selector="[data-index='websites']._show" timeout="30"/>
8181
<element name="website" type="checkbox" selector="//label[contains(text(), '{{var1}}')]/parent::div//input[@type='checkbox']" parameterized="true"/>
82+
<element name="websiteChecked" type="checkbox" selector="//label[contains(text(), '{{var1}}')]/parent::div//input[@type='checkbox'][@value='1']" parameterized="true"/>
8283
</section>
8384
<section name="ProductDesignSection">
8485
<element name="DesignTab" type="button" selector="//strong[@class='admin__collapsible-title']//span[text()='Design']"/>

app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Websites.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,9 @@ protected function getFieldsForFieldset()
175175
$label = __('Websites');
176176

177177
$defaultWebsiteId = $this->websiteRepository->getDefault()->getId();
178-
$isOnlyOneWebsiteAvailable = count($websitesList) === 1;
179178
foreach ($websitesList as $website) {
180179
$isChecked = in_array($website['id'], $websiteIds)
181-
|| ($defaultWebsiteId == $website['id'] && $isNewProduct)
182-
|| $isOnlyOneWebsiteAvailable;
180+
|| ($defaultWebsiteId == $website['id'] && $isNewProduct);
183181
$children[$website['id']] = [
184182
'arguments' => [
185183
'data' => [

app/code/Magento/Downloadable/Observer/SaveDownloadableOrderItemObserver.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,14 @@ public function execute(\Magento\Framework\Event\Observer $observer)
131131
ScopeInterface::SCOPE_STORE
132132
);
133133
$linkPurchased->setLinkSectionTitle($linkSectionTitle)->save();
134+
135+
$linkStatus = \Magento\Downloadable\Model\Link\Purchased\Item::LINK_STATUS_PENDING;
136+
if ($orderStatusToEnableItem == \Magento\Sales\Model\Order\Item::STATUS_PENDING
137+
|| $orderItem->getOrder()->getState() == \Magento\Sales\Model\Order::STATE_COMPLETE
138+
) {
139+
$linkStatus = \Magento\Downloadable\Model\Link\Purchased\Item::LINK_STATUS_AVAILABLE;
140+
}
141+
134142
foreach ($linkIds as $linkId) {
135143
if (isset($links[$linkId])) {
136144
$linkPurchasedItem = $this->_createPurchasedItemModel()->setPurchasedId(
@@ -158,9 +166,7 @@ public function execute(\Magento\Framework\Event\Observer $observer)
158166
)->setNumberOfDownloadsBought(
159167
$numberOfDownloads
160168
)->setStatus(
161-
\Magento\Sales\Model\Order\Item::STATUS_PENDING == $orderStatusToEnableItem ?
162-
\Magento\Downloadable\Model\Link\Purchased\Item::LINK_STATUS_AVAILABLE :
163-
\Magento\Downloadable\Model\Link\Purchased\Item::LINK_STATUS_PENDING
169+
$linkStatus
164170
)->setCreatedAt(
165171
$orderItem->getCreatedAt()
166172
)->setUpdatedAt(
@@ -170,7 +176,6 @@ public function execute(\Magento\Framework\Event\Observer $observer)
170176
}
171177
}
172178
}
173-
174179
return $this;
175180
}
176181

0 commit comments

Comments
 (0)