Skip to content

Commit 7b295e0

Browse files
committed
Added Product ID to list of available Product Identifiers
1 parent 94eec00 commit 7b295e0

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Model/AbstractDataLayer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ protected function getProductAttributeValue(Product $product, ?string $attribute
217217
{
218218
if ($attributeCode) {
219219
$result = $product->getData($attributeCode);
220-
if (is_numeric($result) && 'sku' != $attributeCode) {
220+
if (is_numeric($result) && !in_array($attributeCode, ['sku', 'entity_id'])) {
221221
$result = $product->getResource()->getAttribute($attributeCode)->getFrontend()->getValue($product);
222222
}
223223

Model/Config/Source/ProductAttribute.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ public function toOptionArray(): array
4444
if ($this->options === null) {
4545
$this->options = [];
4646

47+
$this->options[] = [
48+
'value' => 'entity_id',
49+
'label' => 'Product ID'
50+
];
51+
4752
$attributeCollection = $this->attributeCollectionFactory->create();
4853
$attributeCollection->addVisibleFilter()
4954
->setOrder('frontend_label', 'ASC');

0 commit comments

Comments
 (0)