Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
coconva2118
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Hanumant Pratap Singh
coconva2118
Commits
924b9066
Commit
924b9066
authored
Nov 01, 2019
by
Ketan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
http://silos.incaendo.com/hanumant/coconva2118
into develop
parents
dd377e0e
c67be731
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
0 deletions
+50
-0
list.phtml
...nd/Sm/shop4u/Magento_Catalog/templates/product/list.phtml
+50
-0
No files found.
app/design/frontend/Sm/shop4u/Magento_Catalog/templates/product/list.phtml
View file @
924b9066
...
...
@@ -21,6 +21,55 @@ $_productCollection = $block->getLoadedProductCollection();
$_helper
=
$this
->
helper
(
'Magento\Catalog\Helper\Output'
);
$_config
=
$this
->
helper
(
'Sm\Shop4u\Helper\Data'
);
?>
<?php
$objectManager
=
\Magento\Framework\App\ObjectManager
::
getInstance
();
$category
=
$objectManager
->
get
(
'Magento\Framework\Registry'
)
->
registry
(
'current_category'
);
//get current category
$catId
=
$category
->
getId
();
// $catId = 206;
$subCategory
=
$objectManager
->
create
(
'Magento\Catalog\Model\Category'
)
->
load
(
$catId
);
$subCats
=
$subCategory
->
getChildrenCategories
();
$_helper
=
$this
->
helper
(
'Magento\Catalog\Helper\Output'
);
?>
<?php
if
(
$catId
==
206
)
:
?>
<div
class=
"category-product products wrapper grid products-grid"
>
<ol
class=
"products list items product-items row"
>
<?php
foreach
(
$subCats
as
$subcat
)
{
$_category
=
$objectManager
->
create
(
'Magento\Catalog\Model\Category'
)
->
load
(
$subcat
->
getId
());
$subcaturl
=
$subcat
->
getUrl
();
$_imgHtml
=
''
;
if
(
$_imgUrl
=
$_category
->
getImageUrl
())
{
$_imgHtml
=
'<img src="'
.
$_imgUrl
.
'" />'
;
$_imgHtml
=
$_helper
->
categoryAttribute
(
$_category
,
$_imgHtml
,
'image'
);
}
?>
<li
class=
"item product product-item"
>
<div
class=
"product-item-info"
data-container=
"product-grid"
>
<div
class=
"item-inner"
>
<div
class=
"box-image"
>
<a
href=
"
<?php
echo
$subcaturl
;
?>
"
>
<span
class=
"product-image-container"
>
<span
class=
"product-image-wrapper"
>
<?php
echo
$_imgHtml
;
?>
</span>
</span>
</a>
</div>
<div
class=
"product details product-item-details box-info"
>
<h2
class=
"product name product-item-name product-name"
>
<a
class=
"product-item-link"
href=
"
<?php
echo
$subcaturl
;
?>
"
>
<?php
echo
$subcat
->
getName
();
?>
</a>
</h2>
</div>
</div>
</div>
</li>
<?php
}
?>
</ol>
</div>
<?php
else
:?>
<?
php
if
(
!
$_productCollection
->
count
())
:
?>
<div
class=
"message info empty"
>
<div>
<?php
/* @escapeNotVerified */
...
...
@@ -364,3 +413,4 @@ $_config = $this->helper('Sm\Shop4u\Helper\Data');
</script>
<?php
endif
;
?>
<?php
endif
;
?>
<?php
endif
;
?>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment