Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
joshine
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
joshine
Commits
bc92aceb
Commit
bc92aceb
authored
Sep 07, 2022
by
王东红
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
e1cf35ff
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
13 deletions
+34
-13
app/code/JTool/toolbar/Plugin/Catalog/Block/Toolbar.php
+8
-1
app/code/JTool/toolbar/Plugin/Catalog/Model/Config.php
+1
-0
app/code/Magento/Catalog/view/frontend/templates/product/list.phtml
+13
-12
app/design/frontend/Joshine/breeze/web/css/_custom.less
+12
-0
No files found.
app/code/JTool/toolbar/Plugin/Catalog/Block/Toolbar.php
View file @
bc92aceb
...
@@ -23,7 +23,14 @@ class Toolbar
...
@@ -23,7 +23,14 @@ class Toolbar
{
{
$this
->
_collection
->
getSelect
()
->
order
(
'e.created_at DESC'
);
$this
->
_collection
->
getSelect
()
->
order
(
'e.created_at DESC'
);
}
}
elseif
(
$currentOrder
==
'best_seller'
)
{
$subject
->
getCollection
()
->
getSelect
()
->
joinLeft
(
'sales_order_item'
,
'e.entity_id = sales_order_item.product_id'
,
array
(
'qty_ordered'
=>
'(select sum(soi.qty_ordered) from sales_order_item soi where soi.product_id = e.entity_id)'
))
->
distinct
(
true
)
->
order
(
'qty_ordered desc'
);
}
}
}
return
$result
;
return
$result
;
}
}
...
...
app/code/JTool/toolbar/Plugin/Catalog/Model/Config.php
View file @
bc92aceb
...
@@ -6,6 +6,7 @@ class Config
...
@@ -6,6 +6,7 @@ class Config
{
{
public
function
afterGetAttributeUsedForSortByArray
(
\Magento\Catalog\Model\Config
$catalogConfig
,
$options
)
public
function
afterGetAttributeUsedForSortByArray
(
\Magento\Catalog\Model\Config
$catalogConfig
,
$options
)
{
{
$options
[
'best_seller'
]
=
__
(
'Best Seller'
);
$options
[
'new_arrivals'
]
=
__
(
'New Arrivals'
);
$options
[
'new_arrivals'
]
=
__
(
'New Arrivals'
);
$options
[
'low_to_high'
]
=
__
(
'Price Low To High'
);
$options
[
'low_to_high'
]
=
__
(
'Price Low To High'
);
$options
[
'high_to_low'
]
=
__
(
'Price High To Low'
);
$options
[
'high_to_low'
]
=
__
(
'Price High To Low'
);
...
...
app/code/Magento/Catalog/view/frontend/templates/product/list.phtml
View file @
bc92aceb
...
@@ -66,6 +66,7 @@ $_helper = $block->getData('outputHelper');
...
@@ -66,6 +66,7 @@ $_helper = $block->getData('outputHelper');
<?=
$productImage->toHtml
() ?>
<?=
$productImage->toHtml
() ?>
</a>
</a>
<div class="
product
details
product
-
item
-
details
">
<div class="
product
details
product
-
item
-
details
">
<?=
$block->getProductDetailsHtml
(
$_product
) ?>
<?php
$_productNameStripped
=
$block->stripTags
(
$_product->getName
(), null, true); ?>
<?php
$_productNameStripped
=
$block->stripTags
(
$_product->getName
(), null, true); ?>
<strong class="
product
name
product
-
item
-
name
">
<strong class="
product
name
product
-
item
-
name
">
<a class="
product
-
item
-
link
"
<a class="
product
-
item
-
link
"
...
@@ -76,7 +77,7 @@ $_helper = $block->getData('outputHelper');
...
@@ -76,7 +77,7 @@ $_helper = $block->getData('outputHelper');
<?=
$block
->
getReviewsSummaryHtml
(
$_product
,
$templateType
)
?>
<?=
$block
->
getReviewsSummaryHtml
(
$_product
,
$templateType
)
?>
<?=
/* @noEscape */
$block
->
getProductPrice
(
$_product
)
?>
<?=
/* @noEscape */
$block
->
getProductPrice
(
$_product
)
?>
<?=
$block
->
getProductDetailsHtml
(
$_product
)
?>
<div
class=
"product-item-inner"
>
<div
class=
"product-item-inner"
>
<div
class=
"product actions product-item-actions"
>
<div
class=
"product actions product-item-actions"
>
...
@@ -102,12 +103,12 @@ $_helper = $block->getData('outputHelper');
...
@@ -102,12 +103,12 @@ $_helper = $block->getData('outputHelper');
/* @noEscape */
$postParams
[
'data'
][
Action
::
PARAM_NAME_URL_ENCODED
]
/* @noEscape */
$postParams
[
'data'
][
Action
::
PARAM_NAME_URL_ENCODED
]
?>
"
>
?>
"
>
<?=
$block
->
getBlockHtml
(
'formkey'
)
?>
<?=
$block
->
getBlockHtml
(
'formkey'
)
?>
<button
type=
"submit"
<!-- <button type="submit"-->
title=
"
<?=
$escaper
->
escapeHtmlAttr
(
__
(
'Add to Cart'
))
?>
"
<!-- title="-->
<?
//= $escaper->escapeHtmlAttr(__('Add to Cart')) ?><!--"-->
class=
"action tocart primary"
<!--
class
="
action
tocart
primary
"-->
disabled
>
<!-- disabled>--
>
<span>
<?=
$escaper
->
escapeHtml
(
__
(
'Add to Cart'
))
?>
</span
>
<!-- <span>--><?//=
$escaper->escapeHtml
(__('Add to Cart')) ?><!--</span>--
>
</button
>
<!-- </button>--
>
</form>
</form>
<?php else:?>
<?php else:?>
<?php if (
$_product->isAvailable
()):?>
<?php if (
$_product->isAvailable
()):?>
...
@@ -124,11 +125,11 @@ $_helper = $block->getData('outputHelper');
...
@@ -124,11 +125,11 @@ $_helper = $block->getData('outputHelper');
$position
,
$position
,
'product-item-info_' .
$_product->getId
() . ' div.actions-primary'
'product-item-info_' .
$_product->getId
() . ' div.actions-primary'
) : '' ?>
) : '' ?>
<div data-role="
add
-
to
-
links
" class="
actions
-
secondary
"
>
<!-- <div data-role="
add
-
to
-
links
" class="
actions
-
secondary
">--
>
<?php
if (
$addToBlock
=
$block->getChildBlock
('addto')): ?>
<!-- --><?php //
if (
$addToBlock
=
$block->getChildBlock
('addto')): ?>
<?
=
$addToBlock->setProduct
(
$_product
)->getChildHtml() ?>
<!-- --><?//
=
$addToBlock->setProduct
(
$_product
)->getChildHtml() ?>
<?php
endif; ?>
<!-- --><?php //
endif; ?>
</div
>
<!-- </div>--
>
<?= strpos(
$pos
,
$viewMode
. '-secondary') ?
<?= strpos(
$pos
,
$viewMode
. '-secondary') ?
/* @noEscape */
$secureRenderer->renderStyleAsTag
(
/* @noEscape */
$secureRenderer->renderStyleAsTag
(
$position
,
$position
,
...
...
app/design/frontend/Joshine/breeze/web/css/_custom.less
View file @
bc92aceb
...
@@ -20,3 +20,14 @@
...
@@ -20,3 +20,14 @@
.products .product-item-photo img,#product-options-wrapper .swatch-option.image{
.products .product-item-photo img,#product-options-wrapper .swatch-option.image{
margin: 0;
margin: 0;
}
}
.products-grid .product-item .product.name a{
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
cursor: pointer;
width: 100%;
display: inline-block;
color: #222222;
margin-top: 5px;
}
\ 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