Skip to content

Commit d5af5e3

Browse files
committed
ACP2E-877: Customers not filtered by 'Signed up point' when creating an order in Admin
- Fixed the issue.
1 parent 09c80c7 commit d5af5e3

File tree

1 file changed

+32
-0
lines changed
  • app/code/Magento/Sales/Model/ResourceModel/Order/Customer

1 file changed

+32
-0
lines changed

app/code/Magento/Sales/Model/ResourceModel/Order/Customer/Collection.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Magento\Framework\DataObject\Copy\Config;
1616
use Magento\Framework\DB\Adapter\AdapterInterface;
1717
use Magento\Framework\Event\ManagerInterface;
18+
use Magento\Framework\Exception\LocalizedException;
1819
use Magento\Framework\Model\ResourceModel\Db\VersionControl\Snapshot;
1920
use Magento\Framework\Validator\UniversalFactory;
2021
use Magento\Store\Model\StoreManagerInterface;
@@ -154,4 +155,35 @@ protected function beforeAddLoadedItem(DataObject $item): DataObject
154155

155156
return parent::beforeAddLoadedItem($item);
156157
}
158+
159+
/**
160+
* @inheritDoc
161+
* @throws LocalizedException
162+
*/
163+
public function addFieldToFilter($field, $condition = null)
164+
{
165+
if ($field === 'store_name') {
166+
$this->joinField(
167+
'store_name',
168+
'store',
169+
'name',
170+
'store_id=store_id',
171+
null,
172+
'left'
173+
);
174+
}
175+
176+
if ($field === 'website_name') {
177+
$this->joinField(
178+
'website_name',
179+
'store_website',
180+
'name',
181+
'website_id=website_id',
182+
null,
183+
'left'
184+
);
185+
}
186+
187+
return parent::addFieldToFilter($field, $condition);
188+
}
157189
}

0 commit comments

Comments
 (0)