File tree Expand file tree Collapse file tree 2 files changed +50
-0
lines changed
Plugin/Frontend/MageSuite/ProductTile/Block/Tile Expand file tree Collapse file tree 2 files changed +50
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * Copyright © Magefan (support@magefan.com). All rights reserved.
4+ * Please visit Magefan.com for license details (https://magefan.com/end-user-license-agreement).
5+ */
6+
7+ declare (strict_types=1 );
8+
9+ namespace Magefan \ProductLabel \Plugin \Frontend \MageSuite \ProductTile \Block \Tile ;
10+
11+ use Magefan \ProductLabel \Model \Config ;
12+ use Magefan \ProductLabel \Model \Parser \Html ;
13+
14+ class Container
15+ {
16+ /**
17+ * @var Config
18+ */
19+ protected $ config ;
20+
21+ /**
22+ * @param Config $config
23+ */
24+ public function __construct (
25+ Config $ config
26+ )
27+ {
28+ $ this ->config = $ config ;
29+ }
30+
31+ /**
32+ * @param $subject
33+ * @param $result
34+ * @return mixed|string
35+ */
36+ public function afterToHtml ($ subject , $ result )
37+ {
38+ if ($ result && $ this ->config ->isEnabled ()) {
39+ if ($ subject ->getData ('html_tag ' ) == 'figure ' ) {
40+ return $ result . Html::COMMENT_PREFIX . $ subject ->getProduct ()->getId () . Html::COMMENT_SUFFIX ;
41+ }
42+ }
43+
44+ return $ result ;
45+ }
46+ }
Original file line number Diff line number Diff line change 1616 <type name =" Magento\Catalog\Block\Product\View\Gallery" >
1717 <plugin name =" wrap_gallery_image_with_mf_comments" type =" Magefan\ProductLabel\Plugin\Frontend\Magento\Catalog\Block\Product\View\Gallery" sortOrder =" 10" disabled =" false" />
1818 </type >
19+
20+ <type name =" MageSuite\ProductTile\Block\Tile\Container" >
21+ <plugin name =" add_mf_comments_to_mage_suite_product_tile" type =" Magefan\ProductLabel\Plugin\Frontend\MageSuite\ProductTile\Block\Tile\Container" sortOrder =" 10" disabled =" false" />
22+ </type >
1923</config >
You can’t perform that action at this time.
0 commit comments