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
309071f1
Commit
309071f1
authored
Feb 22, 2023
by
lmf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化产品详情页面材质和描述位置和尺寸
增加产品列表和详情折扣标签
parent
6e8fb1f4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
85 additions
and
6 deletions
+85
-6
app/design/frontend/Joshine/breeze/Magento_Catalog/templates/product/price/final_price.phtml
+67
-0
app/design/frontend/Joshine/breeze/Magento_Catalog/templates/product/view/addto.phtml
+10
-5
app/design/frontend/Joshine/breeze/Magento_ConfigurableProduct/templates/product/price/final_price.phtml
+8
-1
No files found.
app/design/frontend/Joshine/breeze/Magento_Catalog/templates/product/price/final_price.phtml
0 → 100644
View file @
309071f1
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
?>
<?php
/** @var \Magento\Catalog\Pricing\Render\FinalPriceBox $block */
/** ex: \Magento\Catalog\Pricing\Price\RegularPrice */
/** @var \Magento\Framework\Pricing\Price\PriceInterface $priceModel */
$priceModel
=
$block
->
getPriceType
(
'regular_price'
);
/** ex: \Magento\Catalog\Pricing\Price\FinalPrice */
/** @var \Magento\Framework\Pricing\Price\PriceInterface $finalPriceModel */
$finalPriceModel
=
$block
->
getPriceType
(
'final_price'
);
$idSuffix
=
$block
->
getIdSuffix
()
?
$block
->
getIdSuffix
()
:
''
;
$schema
=
(
$block
->
getZone
()
==
'item_view'
)
?
true
:
false
;
?>
<?php
if
(
$block
->
hasSpecialPrice
())
:?>
<
span
class
="
special
-
price
">
<?= /* @noEscape */
$block->renderAmount
(
$finalPriceModel->getAmount
(), [
'display_label' => '',
'price_id' =>
$block->getPriceId
('product-price-' .
$idSuffix
),
'price_type' => 'finalPrice',
'include_container' => false,
'schema' =>
$schema
]); ?>
</span>
<span class="
old
-
price
">
<?= /* @noEscape */
$block->renderAmount
(
$priceModel->getAmount
(), [
'display_label' => '',
'price_id' =>
$block->getPriceId
('old-price-' .
$idSuffix
),
'price_type' => 'oldPrice',
'include_container' => true,
'skip_adjustments' => true
]); ?>
</span>
<?php
$seller
= number_format((1 - number_format(
$finalPriceModel->getAmount
()->getValue() /
$priceModel->getAmount
()->getValue(),2)) *100,0) ?>
<?php if (!
$block->isProductList
()) :?>
<span style="
background
-
color
:
#ee0000;height: 20px;color: #ffffff;font-size: 16px;font-weight: 600;margin-left: 10px;padding: 2px;">SAVE <?=$seller?>%</span>
<?
php
else
:?>
<
span
style
=
"position: absolute;left: 15px;top: 15px;z-index: 1;color: #ffffff;background-color: #ee0000;font-size: 16px;font-weight: 600;"
>
SAVE
<?=
$seller
?>
%
</span>
<?php
endif
;
?>
<?php
else
:?>
<?=
/* @noEscape */
$block
->
renderAmount
(
$finalPriceModel
->
getAmount
(),
[
'price_id'
=>
$block
->
getPriceId
(
'product-price-'
.
$idSuffix
),
'price_type'
=>
'finalPrice'
,
'include_container'
=>
true
,
'schema'
=>
$schema
]);
?>
<?php
endif
;
?>
<?php
if
(
$block
->
showMinimalPrice
())
:?>
<?
php
if
(
$block
->
getUseLinkForAsLowAs
())
:?>
<
a
href
=
"<?=
$block->escapeUrl
(
$block->getSaleableItem
()->getProductUrl()) ?>"
class
="
minimal
-
price
-
link
">
<?= /* @noEscape */
$block->renderAmountMinimal
() ?>
</a>
<?php else :?>
<span class="
minimal
-
price
-
link
">
<?= /* @noEscape */
$block->renderAmountMinimal
() ?>
</span>
<?php endif?>
<?php endif; ?>
app/design/frontend/Joshine/breeze/Magento_Catalog/templates/product/view/addto.phtml
View file @
309071f1
...
@@ -191,10 +191,12 @@
...
@@ -191,10 +191,12 @@
.joshine-desction
.desction-info
p
{
.joshine-desction
.desction-info
p
{
word-wrap
:
break-word
;
word-wrap
:
break-word
;
}
}
@media
(
min-width
:
780px
){
@media
(
min-width
:
780px
){
.
joshine-desction
#
description
{
.
product-view-
description
{
max-height
:
450px
;
max-height
:
450px
;
overflow
:
auto
;
overflow
:
auto
;
width
:
100%
;
}
}
}
}
...
@@ -204,6 +206,9 @@
...
@@ -204,6 +206,9 @@
}
}
</style>
</style>
<div
class=
"product-view-description"
>
<?php
<?php
$short_description
=
$this
->
helper
(
Magento\Catalog\Helper\Output
::
class
)
->
productAttribute
(
$short_description
=
$this
->
helper
(
Magento\Catalog\Helper\Output
::
class
)
->
productAttribute
(
$block
->
getShortDescription
(),
$block
->
getShortDescription
(),
...
@@ -245,7 +250,7 @@ if ($short_description) :
...
@@ -245,7 +250,7 @@ if ($short_description) :
<div
class=
"joshine-desction"
>
<div
class=
"joshine-desction"
>
<div
id=
"accordion"
data-mage-init=
'{
<div
id=
"accordion"
data-mage-init=
'{
"accordion":{
"accordion":{
"active": [
1, 2
],
"active": [
0
],
"collapsible": true,
"collapsible": true,
"openedState": "active",
"openedState": "active",
"multipleCollapsible": true
"multipleCollapsible": true
...
@@ -253,10 +258,10 @@ if ($short_description) :
...
@@ -253,10 +258,10 @@ if ($short_description) :
<div
data-role=
"collapsible"
>
<div
data-role=
"collapsible"
>
<div
data-role=
"trigger"
class=
"short_description-button"
>
<div
data-role=
"trigger"
class=
"short_description-button"
>
<a
class=
"desction-left short_description info-desc"
href=
"#"
>
Material
</a>
<a
class=
"desction-left short_description info-desc"
href=
"#"
>
Material
</a>
<a
class=
"desction-right short_description info-desc"
href=
"#"
>
+
</a>
<a
class=
"desction-right short_description info-desc"
href=
"#"
>
-
</a>
</div>
</div>
</div>
</div>
<div
data-role=
"content"
id=
"
description
"
>
<div
data-role=
"content"
id=
"
material
"
>
<div
class=
"desction-info"
>
<div
class=
"desction-info"
>
<?php
echo
$short_description
;
?>
<?php
echo
$short_description
;
?>
</div>
</div>
...
@@ -265,7 +270,7 @@ if ($short_description) :
...
@@ -265,7 +270,7 @@ if ($short_description) :
</div>
</div>
<?php
endif
;
<?php
endif
;
?>
?>
</div>
<script>
<script>
require
([
require
([
'jquery'
'jquery'
...
...
app/design/frontend/Joshine/breeze/Magento_ConfigurableProduct/templates/product/price/final_price.phtml
View file @
309071f1
...
@@ -12,6 +12,7 @@ $finalPriceModel = $block->getPriceType('final_price');
...
@@ -12,6 +12,7 @@ $finalPriceModel = $block->getPriceType('final_price');
$idSuffix
=
$block
->
getIdSuffix
()
?
$block
->
getIdSuffix
()
:
''
;
$idSuffix
=
$block
->
getIdSuffix
()
?
$block
->
getIdSuffix
()
:
''
;
$schema
=
(
$block
->
getZone
()
==
'item_view'
)
?
true
:
false
;
$schema
=
(
$block
->
getZone
()
==
'item_view'
)
?
true
:
false
;
?>
?>
<span
class=
"normal-price"
>
<span
class=
"normal-price"
>
<?=
/* @noEscape */
$block
->
renderAmount
(
$finalPriceModel
->
getAmount
(),
[
<?=
/* @noEscape */
$block
->
renderAmount
(
$finalPriceModel
->
getAmount
(),
[
'display_label'
=>
__
(
''
),
'display_label'
=>
__
(
''
),
...
@@ -32,19 +33,25 @@ $schema = ($block->getZone() == 'item_view') ? true : false;
...
@@ -32,19 +33,25 @@ $schema = ($block->getZone() == 'item_view') ? true : false;
'skip_adjustments'
=>
true
'skip_adjustments'
=>
true
]);
?>
]);
?>
</span>
</span>
<?php
$seller
=
number_format
((
1
-
number_format
(
$finalPriceModel
->
getAmount
()
->
getValue
()
/
$priceModel
->
getAmount
()
->
getValue
(),
2
))
*
100
,
0
)
?>
<span
style=
"position: absolute;left: 15px;top: 15px;z-index: 1;color: #ffffff;background-color: #ee0000;font-size: 16px;font-weight: 600;"
>
SAVE
<?=
$seller
?>
%
</span>
<?php
endif
;
?>
<?php
endif
;
?>
<?php
if
(
!
$block
->
isProductList
()
&&
$block
->
hasSpecialPrice
())
:
?>
<?php
if
(
!
$block
->
isProductList
()
&&
$block
->
hasSpecialPrice
())
:
?>
<span
class=
"old-price sly-old-price no-display"
>
<span
class=
"old-price sly-old-price no-display"
>
<?=
/* @noEscape */
$block
->
renderAmount
(
$priceModel
->
getAmount
(),
[
<?=
/* @noEscape */
$block
->
renderAmount
(
$priceModel
->
getAmount
(),
[
'display_label'
=>
__
(
'Regular Price'
),
'display_label'
=>
__
(
'Regular Price
2
'
),
'price_id'
=>
$block
->
getPriceId
(
'old-price-'
.
$idSuffix
),
'price_id'
=>
$block
->
getPriceId
(
'old-price-'
.
$idSuffix
),
'price_type'
=>
'oldPrice'
,
'price_type'
=>
'oldPrice'
,
'include_container'
=>
true
,
'include_container'
=>
true
,
'skip_adjustments'
=>
true
'skip_adjustments'
=>
true
]);
?>
]);
?>
</span>
</span>
<?php
$seller
=
number_format
((
1
-
number_format
(
$finalPriceModel
->
getAmount
()
->
getValue
()
/
$priceModel
->
getAmount
()
->
getValue
(),
2
))
*
100
,
0
)
?>
<span
style=
"background-color: #ee0000;height: 20px;color: #ffffff;font-size: 16px;font-weight: 600;margin-left: 10px;padding: 2px;"
>
SAVE
<?=
$seller
?>
%
</span>
<?php
endif
;
?>
<?php
endif
;
?>
<?php
if
(
$block
->
showMinimalPrice
())
:
?>
<?php
if
(
$block
->
showMinimalPrice
())
:
?>
...
...
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