Skip to content

Commit

Permalink
https://github.com/cabinetsbay/catalog/issues/38
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrii-fediuk committed Jun 18, 2024
1 parent 39552b3 commit 4b8507f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
37 changes: 20 additions & 17 deletions view/frontend/templates/products/not-empty.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,26 @@ echo $b->getToolbarHtml() . $b->getAdditionalHtml();
# "The frontend product list pages should show products as a list on narrow screens and as a grid on wide screens":
# https://github.com/cabinetsbay/catalog/issues/40
$viewMode = 'list';
echo df_tag('div', df_cc_s('products', 'wrapper', $viewMode, "products-$viewMode"), df_cc_n(
# 2024-03-10
# 1.1) Level 0: «Root Catalog».
# 1.2) Level 1: «Default Category».
# 1.3) Level 2:
# «Ready to Assemble Cabinets»
# «Pre-Assembled Cabinets»
# «Cabinet Organizers & Hardware»
# 2024-06-10
# 1) "Handle category levels > 3": https://github.com/cabinetsbay/catalog/issues/36
# 2.1) Level 4: https://localhost.com:2255/ready-to-assemble-cabinets/croydon-white-shaker/pantry-oven-cabinets.html
# 2.2) Level 5: https://localhost.com:2255/ready-to-assemble-cabinets/croydon-white-shaker/pantry-oven-cabinets/pantry-cabinets.html
3 === df_category_level() ? '' : df_tag('h3', [], df_category_current()->getName())
,df_tag('ol', 'products list items product-items', df_cc_n(df_map(function(P $p) use($b):string {return df_block_output(
'CabinetsBay_Catalog', 'products/not-empty/product', ['b' => $b, 'p' => $p]
);}, $b->getLoadedProductCollection())))
));
echo df_tag('div',
df_cc_s('products', 'wrapper', $viewMode, "products-$viewMode")
,df_cc_n(
# 2024-03-10
# 1.1) Level 0: «Root Catalog».
# 1.2) Level 1: «Default Category».
# 1.3) Level 2:
# «Ready to Assemble Cabinets»
# «Pre-Assembled Cabinets»
# «Cabinet Organizers & Hardware»
# 2024-06-10
# 1) "Handle category levels > 3": https://github.com/cabinetsbay/catalog/issues/36
# 2.1) Level 4: https://localhost.com:2255/ready-to-assemble-cabinets/croydon-white-shaker/pantry-oven-cabinets.html
# 2.2) Level 5: https://localhost.com:2255/ready-to-assemble-cabinets/croydon-white-shaker/pantry-oven-cabinets/pantry-cabinets.html
3 === df_category_level() ? '' : df_tag('h3', [], df_category_current()->getName())
,df_tag('ol', 'products list items product-items', df_cc_n(df_map(function(P $p) use($b):string {return df_block_output(
'CabinetsBay_Catalog', 'products/not-empty/product', ['b' => $b, 'p' => $p]
);}, $b->getLoadedProductCollection())))
)
);
echo $b->getChildBlock('toolbar')->setIsBottom(true)->toHtml();
if (!$b->isRedirectToCartEnabled()) {
$lastProduct = df_last($b->getLoadedProductCollection()); /** @var P $lastProduct */
Expand Down
1 change: 0 additions & 1 deletion view/frontend/web/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
// @used-by https://github.com/cabinetsbay/core/blob/0.3.5/view/frontend/templates/head.phtml#L35
define(['jquery', 'domReady!'], $ => {
const $w = $(window);
//return;
// 2024-06-17 I use `div.` to distinguish the element from `ol.products`.
const $c = $('div.products', $('body.page-products'));
if ($c.length) {
Expand Down

0 comments on commit 4b8507f

Please sign in to comment.