-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
https://github.com/cabinetsbay/core/issues/6
- Loading branch information
1 parent
e1645d5
commit 05bc054
Showing
11 changed files
with
307 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,20 @@ | ||
<?php | ||
# 2024-03-25 | ||
# "Refactor `app/design/frontend/Cabinetsbay/cabinetsbay_default/Magento_Catalog/templates/category/header.phtml`": | ||
# https://github.com/cabinetsbay/site/issues/105 | ||
use Magento\Catalog\Model\Category as C; | ||
/** @var C $c */ | ||
?> | ||
<a href='<?= $c->getUrl() ?>'> | ||
<div><?= $c->getName() ?></div> | ||
<?php if ($set = $c['cb_kitchen_set']) { ?> | ||
<div class='size-price'> | ||
<b><?= $set ?></b><?= $c['cb_kitchen_price'] ?> | ||
</div> | ||
<?php } ?> | ||
<img border='0' src='<?= $c->getImageUrl() ?>'/> | ||
</a> | ||
<div> | ||
<a href='<?= $c->getUrl() ?>'>Shop cabinets</a> | ||
<a href='<?= $c['cb_door_sample_link'] ?>'>Order sample</a> | ||
</div> |
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,21 @@ | ||
<?php | ||
# 2024-03-15 | ||
# "Refactor `app/design/frontend/Cabinetsbay/cabinetsbay_default/Magento_Catalog/templates/category/view.phtml`": | ||
# https://github.com/cabinetsbay/site/issues/112 | ||
use Sharapov\Cabinetsbay\Block\Category\View as B; | ||
/** @var B $b */ | ||
$id = $b->isRTA() ? 'rta' : 'pa'; /** @var string $id */ | ||
?> | ||
<div class='product-page-faq' id='faq-purchase'> | ||
<?= df_cms_block("product-page-faq-{$id}-welcome") ?> | ||
</div> | ||
<div class='product-page-faq'> | ||
<?= df_cms_block("product-page-faq-{$id}-body") ?> | ||
</div> | ||
<div class='product-page-how-to-shop mobile-view' id='how-to-shop'> | ||
<?= df_cms_block("product-page-{$id}-how-to-shop") ?> | ||
<a href='#products_list' class='scrollTo'>Click here to start shopping</a> | ||
</div> | ||
<div class="product-page-info mobile-view"> | ||
<?= df_cms_block("product-page-{$id}-info") ?> | ||
</div> |
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,10 @@ | ||
<?php | ||
# 2024-03-14 | ||
# "Refactor `app/design/frontend/Cabinetsbay/cabinetsbay_default/Magento_Catalog/templates/category/view.phtml`": | ||
# https://github.com/cabinetsbay/site/issues/112 | ||
use Magento\Catalog\Model\ResourceModel\Category\Collection as CC; | ||
use Sharapov\Cabinetsbay\Block\Category\View as B; | ||
/** @var B $b */ | ||
$cc = df_category_children($b->getCurrentCategory())->setOrder('position', 'ASC'); /** @var CC $cc */ | ||
echo df_block_output('CabinetsBay_Core', 'catalog/category/l2/l3/filters', ['cc' => $cc]); | ||
echo df_block_output('CabinetsBay_Core', 'catalog/category/l2/l3/items', ['cc' => $cc]); |
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,63 @@ | ||
<?php | ||
# 2024-03-14 | ||
# "Refactor `app/design/frontend/Cabinetsbay/cabinetsbay_default/Magento_Catalog/templates/category/view.phtml`": | ||
# https://github.com/cabinetsbay/site/issues/112 | ||
use Magento\Catalog\Model\Category as C; | ||
use Magento\Catalog\Model\ResourceModel\Category\Collection as CC; | ||
/** @var CC $cc */ | ||
$options = function(string $k) use($cc):string { | ||
$all = ['<li data-style="all">All</li>']; | ||
return df_cc_n(array_merge($all, df_map( | ||
# 2024-03-24 | ||
# "Some values are duplicated in filter dropdowns on the «Ready to Assemble Cabinets» page": | ||
# https://github.com/cabinetsbay/site/issues/115 | ||
array_unique(df_map($cc, function(C $c) use($k):string {return $c["cb_kitchen_{$k}"];})) | ||
,function(string $s):string {return df_tag('li', ['data-style' => $s], $s);} | ||
))); | ||
}; | ||
?> | ||
<div class="category-filterblock short-first"> | ||
<div> | ||
<label>Filter</label> | ||
</div> | ||
<div> | ||
<div id="dropdown-price" class="category-filter-dropdown" data-mage-init='{"dropdown":{}}'> | ||
<span class="action toggle" data-toggle="dropdown" aria-haspopup="true"> | ||
<span>Price</span> | ||
</span> | ||
<ul class="dropdown"> | ||
<li data-sortby="asc">Low-High</li> | ||
<li data-sortby="desc">High-Low</li> | ||
</ul> | ||
</div> | ||
</div> | ||
<div> | ||
<div id="dropdown-color" class="category-filter-dropdown" data-mage-init='{"dropdown":{}}'> | ||
<span class="action toggle" data-toggle="dropdown" aria-haspopup="true"> | ||
<span>Color</span> | ||
</span> | ||
<ul class="dropdown"> | ||
<li data-sortby="lighter">Lighter</li> | ||
<li data-sortby="darker">Darker</li> | ||
</ul> | ||
</div> | ||
</div> | ||
<div> | ||
<div id="dropdown-style" class="category-filter-dropdown" data-mage-init='{"dropdown":{}}'> | ||
<span class="action toggle" data-toggle="dropdown" aria-haspopup="true"> | ||
<span>Style (All)</span> | ||
</span> | ||
<ul class="dropdown"> | ||
<?= $options('style') ?> | ||
</ul> | ||
</div> | ||
</div> | ||
<div> | ||
<div id="dropdown-construction" class="category-filter-dropdown" data-mage-init='{"dropdown":{}}'> | ||
<span class="action toggle" data-toggle="dropdown" aria-haspopup="true"> | ||
<span>Cabinet Construction (All)</span> | ||
</span> | ||
<ul class="dropdown"><?= $options('type'); ?></ul> | ||
</div> | ||
</div> | ||
</div> |
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,24 @@ | ||
<?php | ||
# 2024-03-14 | ||
# "Refactor `app/design/frontend/Cabinetsbay/cabinetsbay_default/Magento_Catalog/templates/category/view.phtml`": | ||
# https://github.com/cabinetsbay/site/issues/112 | ||
use Magento\Catalog\Model\Category as C; | ||
use Magento\Catalog\Model\ResourceModel\Category\Collection as CC; | ||
/** @var CC $cc */ | ||
if (count($cc)) { ?> | ||
<div class='c-products-grid'> | ||
<ul id='products_list'> | ||
<?php foreach ($cc as $c) {/** @var C $c */ ?> | ||
<li | ||
data-sortercolor='<?= $c['cb_kitchen_color'] ?>' | ||
data-sorterconstruction='<?= $c['cb_kitchen_type'] ?>' | ||
data-sorterprice='<?= preg_replace('/[^0-9.]+/', '', $c['cb_kitchen_price']) ?>' | ||
data-sorterstyle='<?= $c['cb_kitchen_style'] ?>' | ||
> | ||
<?= df_block_output('CabinetsBay_Core', 'catalog/category/item', ['c' => $c]) ?> | ||
</li> | ||
<?php } ?> | ||
</ul> | ||
</div> | ||
<?php | ||
} |
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,19 @@ | ||
<?php | ||
# 2024-03-14 | ||
# "Refactor `app/design/frontend/Cabinetsbay/cabinetsbay_default/Magento_Catalog/templates/category/view.phtml`": | ||
# https://github.com/cabinetsbay/site/issues/112 | ||
use Sharapov\Cabinetsbay\Block\Category\View as B; | ||
/** @var B $b */ | ||
[$id, $title] = $b->isRTA() ? ['rta', 'RTA'] : ['pa', 'Pre-Assembled']; /** @var string $id */ /** @var string $title */ | ||
?> | ||
<!-- 2024-04-14 | ||
"Titles are incorrectly displayed on the `/pre-assembled-cabinets.html` and `/ready-to-assemble-cabinets.html` pages": | ||
https://github.com/cabinetsbay/site/issues/135 --> | ||
<div class='cb-faq'>Frequently Asked Questions about <?= $title ?> Cabinets | ||
<a href="#faq-purchase" class="scrollTo">Learn More...</a> | ||
</div> | ||
<div class='product-page-info'><?= df_cms_block("product-page-{$id}-info") ?></div> | ||
<div class='product-page-how-to-shop'> | ||
<?= df_cms_block("product-page-{$id}-how-to-shop") ?> | ||
<a class='scrollTo' href='#how-to-shop'>Learn More...</a> | ||
</div> |
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,51 @@ | ||
<?php | ||
# 2024-03-25 | ||
# "Refactor `app/design/frontend/Cabinetsbay/cabinetsbay_default/Magento_Catalog/templates/category/header.phtml`": | ||
# https://github.com/cabinetsbay/site/issues/105 | ||
use Sharapov\Cabinetsbay\Block\Category\View as B; | ||
$tabs = [ | ||
# 2024-04-14 | ||
# "Delete the useless «Product Overview» title from the frontend category pages": | ||
# https://github.com/cabinetsbay/site/issues/133 | ||
'overview'=> ['content' => 'block'] | ||
,'specifications' => ['content' => 'cb_specs', 'title' => 'Specifications'] | ||
,'cabinet-assembly' => ['content' => 'cb_assembly', 'title' => 'Cabinet Assembly'] | ||
,'matching-styles' => ['content' => 'block', 'title' => 'Matching Styles'] | ||
]; /** @var string => array(string => string) $tabs */ | ||
/** @var B $b */ | ||
# 2024-03-25 These tabs are visible on wide screens only. | ||
echo df_tag('ul', 'category-menu', df_map_k(function(string $k, array $v):string {return df_tag('li', | ||
['data-role' => 'title'] | ||
, df_tag('a', [ | ||
# 2024-03-25 | ||
# "The contents of the tabs «Product Overview», «Specifications», «Cabinet Assembly», «Matching Styles» | ||
# should be always visible": https://github.com/cabinetsbay/site/issues/120 | ||
'class' => 'scrollTo' | ||
,'href' => "#$k" | ||
], $v['title']) | ||
# 2024-04-14 | ||
# "Delete the useless «Product Overview» tab from the frontend category pages": https://github.com/cabinetsbay/site/issues/132 | ||
);}, df_tail($tabs))); | ||
foreach ($tabs as $k => $v) {/** @var string $k */ /** @var array(string => string) $v */ ?> | ||
<!-- 2024-03-25 | ||
1) "The contents of the tabs «Product Overview», «Specifications», «Cabinet Assembly», «Matching Styles» | ||
should be always visible": https://github.com/cabinetsbay/site/issues/120 | ||
2) I added the `active` class. --> | ||
<div id='<?= $k ?>' class='active category-tab' data-role='content'> | ||
<!-- 2024-03-25 | ||
1) "The contents of the tabs «Product Overview», «Specifications», «Cabinet Assembly», «Matching Styles» | ||
should be always visible": https://github.com/cabinetsbay/site/issues/120 | ||
2) I removed the code: | ||
<span class='submenu-toggle' data-role='trigger' tabindex='0'></span> | ||
https://github.com/cabinetsbay/core/blob/0.1.4/view/frontend/templates/catalog/category/tabs.phtml#L30 | ||
2024-04-14 "Delete the useless «Product Overview» title from the frontend category pages": | ||
https://github.com/cabinetsbay/site/issues/133 --> | ||
<?= df_tag_if_ne(dfa($v, 'title', ''), 'label') ?> | ||
<div class='content'> | ||
<?= 'block' === ($c = $v['content']) | ||
? df_block_output('CabinetsBay_Core', "catalog/category/tabs/$k", ['b' => $b]) | ||
: $b->l3a($c) | ||
?> | ||
</div> | ||
</div> | ||
<?php } ?> |
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,7 @@ | ||
<?php | ||
# 2024-03-25 | ||
# "Refactor `app/design/frontend/Cabinetsbay/cabinetsbay_default/Magento_Catalog/templates/category/header.phtml`": | ||
# https://github.com/cabinetsbay/site/issues/105 | ||
use Magento\Catalog\Model\Category as C; | ||
use Sharapov\Cabinetsbay\Block\Category\View as B; | ||
/** @var B $b */ |
20 changes: 20 additions & 0 deletions
20
view/frontend/templates/category/tabs/matching-styles.phtml
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,20 @@ | ||
<?php | ||
# 2024-03-25 | ||
# "Refactor `app/design/frontend/Cabinetsbay/cabinetsbay_default/Magento_Catalog/templates/category/header.phtml`": | ||
# https://github.com/cabinetsbay/site/issues/105 | ||
use Magento\Catalog\Model\Category as C; | ||
use Sharapov\Cabinetsbay\Block\Category\View as B; | ||
/** @var B $b */ | ||
echo $b->l3a('cb_styles'); | ||
if (count($cc = $b->l3p())) { /** @var C[] $cc */ ?> | ||
<div class='c-products-grid'> | ||
<ul> | ||
<?php foreach ($cc as $c) {/** @var C $c */ ?> | ||
<li> | ||
<?= df_block_output('CabinetsBay_Core', 'catalog/category/item', ['c' => $c]) ?> | ||
</li> | ||
<?php } ?> | ||
</ul> | ||
</div> | ||
<?php | ||
} |
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,65 @@ | ||
<?php | ||
# 2024-03-25 | ||
# "Refactor `app/design/frontend/Cabinetsbay/cabinetsbay_default/Magento_Catalog/templates/category/header.phtml`": | ||
# https://github.com/cabinetsbay/site/issues/105 | ||
use Magento\Catalog\Model\Category as C; | ||
use Sharapov\Cabinetsbay\Block\Category\View as B; | ||
/** @var B $b */ | ||
df_assert($l3 = $b->l3()); /** @var C $l3 */ | ||
?> | ||
<div class='category-info'> | ||
<div class='category-tab-left'> | ||
<?php if ($ii = $b->images()) { ?> | ||
<ul id='category-gallery' class='gallery list-unstyled cS-hidden'> | ||
<?= | ||
df_cc_n(df_map_k($ii, function(string $f, string $t):string {return | ||
df_tag('li', [ | ||
'data-src' => $u = df_media_path2url("wysiwyg/catalog-carousel-images/$f") | ||
,'data-thumb' => $u | ||
], df_tag('img', ['alt' => $t,'src' => $u, 'title' => $t])) | ||
;})) | ||
?> | ||
</ul> | ||
<script> | ||
require(['jquery', 'domReady!'], function($) { | ||
let totalWidth = 0; | ||
$('.owl-thumb-item').each(function() { | ||
totalWidth += parseInt($(this).width(), 10); | ||
}); | ||
$('.owl-thumbs').css('width', (totalWidth + 20)+'px'); | ||
}); | ||
</script> | ||
<?php } | ||
else { | ||
try { | ||
if ($url = $l3->getImageUrl()) { | ||
echo df_catalog_output()->categoryAttribute( | ||
$l3 | ||
,df_tag('div', 'category-image', df_tag('img', [ | ||
'alt' => $l3->getName() | ||
,'class' => 'image' | ||
,'src' => $url | ||
,'title' => $l3->getName() | ||
])) | ||
,'image' | ||
); | ||
} | ||
} catch (\Magento\Framework\Exception\LocalizedException $e) {} | ||
} | ||
?> | ||
</div> | ||
<div class="category-tab-right"> | ||
<?php if ($_description = $l3->getDescription()): ?> | ||
<div class="category-description"> | ||
<?= df_catalog_output()->categoryAttribute($l3, $_description, 'description') ?> | ||
</div> | ||
<?php endif; ?> | ||
<div class="category-subdescription"> | ||
<div class="table-view"> | ||
<a href="/sample-doors.html">Order Sample</a> | ||
<a href="/kitchen-design-assistance.html">Free Design</a> | ||
</div> | ||
<a class="scrollTo" href="#layer-product-list">Shop Cabinets Below <i></i></a> | ||
</div> | ||
</div> | ||
</div> |
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,7 @@ | ||
<?php | ||
# 2024-03-25 | ||
# "Refactor `app/design/frontend/Cabinetsbay/cabinetsbay_default/Magento_Catalog/templates/category/header.phtml`": | ||
# https://github.com/cabinetsbay/site/issues/105 | ||
use Magento\Catalog\Model\Category as C; | ||
use Sharapov\Cabinetsbay\Block\Category\View as B; | ||
/** @var B $b */ |