Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions src/Model/Resolver/Category/DataProvider/Breadcrumbs.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,19 @@ public function getData(string $categoryPath): array

if (count($parentCategoryIds)) {
$collection = $this->collectionFactory->create();
$collection->addAttributeToSelect(['name', 'url_key', 'url_path', 'is_active']);
$collection->addAttributeToSelect(['name', 'url_key', 'url_path', 'is_active', 'description', 'landing_page']);
$collection->addAttributeToFilter('entity_id', $parentCategoryIds);

foreach ($collection as $category) {

$landingPageId = $category->getData('landing_page');
$landingPageContent = '';

if ($landingPageId) {
$landingPageBlock = $this->blockFactory->create()->load($landingPageId);
$landingPageContent = $landingPageBlock->getContent();
}

$breadcrumbsData[] = [
'category_id' => $category->getId(),
'category_name' => $category->getName(),
Expand All @@ -59,7 +68,10 @@ public function getData(string $categoryPath): array
'category_url_path' => $category->getUrlPath(),
// the only change to fix breadcrumbs
'category_url' => parse_url($category->getUrl(), PHP_URL_PATH),
'category_is_active' => (bool) $category->getIsActive()
'category_is_active' => (bool) $category->getIsActive(),
'category_description' => $category->getDescription() ?? '',
'category_banner' => $landingPageContent,

];
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/etc/schema.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ type ProductStockItem {
extends type Breadcrumb {
category_url: String @doc(description: "Trimmed URL rewrite")
category_is_active: Boolean @doc(description: "Is category active")
category_description: String @doc(description: "Category description")
category_banner: String @doc(description: "Category banner")
}

interface AggregationOptionInterface {
Expand Down