Skip to content

Commit 635c373

Browse files
author
Prabhu Ram
committed
MC-20255: Category Breadcrumbs are missing url_path
- Added category_url_path
1 parent d6ef3ef commit 635c373

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

app/code/Magento/CatalogGraphQl/Model/Resolver/Category/DataProvider/Breadcrumbs.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function getData(string $categoryPath): array
4141

4242
if (count($parentCategoryIds)) {
4343
$collection = $this->collectionFactory->create();
44-
$collection->addAttributeToSelect(['name', 'url_key']);
44+
$collection->addAttributeToSelect(['name', 'url_key', 'url_path']);
4545
$collection->addAttributeToFilter('entity_id', $parentCategoryIds);
4646

4747
foreach ($collection as $category) {
@@ -50,6 +50,7 @@ public function getData(string $categoryPath): array
5050
'category_name' => $category->getName(),
5151
'category_level' => $category->getLevel(),
5252
'category_url_key' => $category->getUrlKey(),
53+
'category_url_path' => $category->getUrlPath(),
5354
];
5455
}
5556
}

app/code/Magento/CatalogGraphQl/etc/schema.graphqls

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ type Breadcrumb @doc(description: "Breadcrumb item."){
231231
category_name: String @doc(description: "Category name.")
232232
category_level: Int @doc(description: "Category level.")
233233
category_url_key: String @doc(description: "Category URL key.")
234+
category_url_path: String @doc(description: "Category URL path.")
234235
}
235236

236237
type CustomizableRadioOption implements CustomizableOptionInterface @doc(description: "CustomizableRadioOption contains information about a set of radio buttons that are defined as part of a customizable option.") {

0 commit comments

Comments
 (0)