-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔃 [EngCom] Public Pull Requests - 2.3-develop
Accepted Public Pull Requests: - #14868: [Forwardport] Fix issue #13944. Show Store Views in Terms and Conditions grid. (by @rostyslav-hymon) - #14867: [forwardport] PR#12712 : Found 2 elements with non-unique id #email (by @julienanquetil) - magento-engcom-team/magento2ce#114: [2.3-develop] Forwardport of #11539 (by @magento-engcom-team) - #14382: Removed unused translation for comment tag (by @yogeshks) Fixed GitHub Issues: - #13944: Stores -> Terms and Conditions - No Store View shown (reported by @raymond62) has been fixed in #14868 by @rostyslav-hymon in 2.3-develop branch Related commits: 1. 9000f74 - #12712: Latest Google Chrome Browser issue with duplicate #email (reported by @lano-vargas) has been fixed in #14867 by @julienanquetil in 2.3-develop branch Related commits: 1. b7c0f1b - #14850: Found 2 elements with non-unique id #email: magento 2 contact (reported by @shivkumarsingh7) has been fixed in #14867 by @julienanquetil in 2.3-develop branch Related commits: 1. b7c0f1b - #9360: <depends> field doesn't work in system.xml for "radios" fields (reported by @WaPoNe) has been fixed in magento-engcom-team/magento2ce#114 by @magento-engcom-team in 2.3-develop branch Related commits: 1. da5692c 2. 9775cd8 3. e10a3ff
- Loading branch information
Showing
9 changed files
with
111 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
app/code/Magento/CheckoutAgreements/Model/ResourceModel/Agreement/Grid/Collection.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\CheckoutAgreements\Model\ResourceModel\Agreement\Grid; | ||
|
||
/** | ||
* CheckoutAgreement Grid Collection | ||
*/ | ||
class Collection extends \Magento\CheckoutAgreements\Model\ResourceModel\Agreement\Collection | ||
{ | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function load($printQuery = false, $logQuery = false) | ||
{ | ||
if ($this->isLoaded()) { | ||
return $this; | ||
} | ||
|
||
parent::load($printQuery, $logQuery); | ||
|
||
$this->addStoresToResult(); | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @return void | ||
*/ | ||
private function addStoresToResult() | ||
{ | ||
$stores = $this->getStoresForAgreements(); | ||
|
||
if (!empty($stores)) { | ||
$storesByAgreementId = []; | ||
|
||
foreach ($stores as $storeData) { | ||
$storesByAgreementId[$storeData['agreement_id']][] = $storeData['store_id']; | ||
} | ||
|
||
foreach ($this as $item) { | ||
$agreementId = $item->getData('agreement_id'); | ||
|
||
if (!isset($storesByAgreementId[$agreementId])) { | ||
continue; | ||
} | ||
|
||
$item->setData('stores', $storesByAgreementId[$agreementId]); | ||
} | ||
} | ||
} | ||
|
||
/** | ||
* @return array | ||
*/ | ||
private function getStoresForAgreements() | ||
{ | ||
$agreementId = $this->getColumnValues('agreement_id'); | ||
|
||
if (!empty($agreementId)) { | ||
$select = $this->getConnection()->select()->from( | ||
['agreement_store' => 'checkout_agreement_store'] | ||
)->where( | ||
'agreement_store.agreement_id IN (?)', | ||
$agreementId | ||
); | ||
|
||
return $this->getConnection()->fetchAll($select); | ||
} | ||
|
||
return []; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters