-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Show brand description on brand page
- Loading branch information
1 parent
e79dc71
commit 60b0b52
Showing
3 changed files
with
42 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace MageSuite\BrandManagement\Block; | ||
|
||
class View extends \Magento\Framework\View\Element\Template | ||
{ | ||
/** | ||
* @var \Magento\Framework\Registry | ||
*/ | ||
protected $registry; | ||
|
||
public function __construct( | ||
\Magento\Framework\View\Element\Template\Context $context, | ||
\Magento\Framework\Registry $registry, | ||
array $data = [] | ||
) { | ||
$this->registry = $registry; | ||
parent::__construct($context, $data); | ||
} | ||
|
||
/** | ||
* @return \MageSuite\BrandManagement\Model\Brands | ||
*/ | ||
public function getBrand() | ||
{ | ||
return $this->registry->registry('current_brand'); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
// @codingStandardsIgnoreFile | ||
/** | ||
* @var $block \Magesuite\BrandManagement\Block\View | ||
*/ | ||
?> | ||
<?php $brand = $block->getBrand() ?> | ||
<?php if ($description = $brand->getFullDescription()): ?> | ||
<div class="cs-cms-block | cs-page-category__description"> | ||
<?php /* @escapeNotVerified */ echo $this->helper('Magento\Catalog\Helper\Output')->categoryAttribute($brand, $description, 'description') ?> | ||
</div> | ||
<?php endif; ?> |