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
b6498894
Commit
b6498894
authored
May 10, 2023
by
liumengfei
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' into production
parents
6af9e6c4
1345f595
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
84 additions
and
81 deletions
+84
-81
app/code/Joshine/InstagramFeed/Block/MediaFeed.php
+1
-1
app/design/frontend/Joshine/breeze/Magento_Catalog/templates/product/list.phtml
+43
-2
app/design/frontend/Joshine/breeze/Magento_Checkout/layout/checkout_cart_index.xml
+1
-1
app/design/frontend/Joshine/breeze/Magento_Checkout/templates/cart/item/default.phtml
+17
-27
app/design/frontend/Joshine/breeze/Magento_Theme/layout/default.xml
+1
-1
app/design/frontend/Joshine/breeze/Magento_Theme/templates/html/footer.phtml
+17
-11
app/design/frontend/Joshine/breeze/Magento_Theme/templates/html/header/logo.phtml
+2
-36
app/design/frontend/Joshine/breeze/web/css/_custom.less
+2
-2
No files found.
app/code/Joshine/InstagramFeed/Block/MediaFeed.php
View file @
b6498894
...
...
@@ -17,7 +17,7 @@ class MediaFeed extends Template {
const
CACHE_TAG
=
'INSTAGRAM_FEED'
;
const
CACHE_LIFETIME
=
60
*
60
;
const
CACHE_LIFETIME
=
60
*
60
*
24
;
protected
$request
;
...
...
app/design/frontend/Joshine/breeze/Magento_Catalog/templates/product/list.phtml
View file @
b6498894
...
...
@@ -113,15 +113,16 @@ $_helper = $block->getData('outputHelper');
}
?>
<?php
// Product Image ?>
<
a
href
=
"<?=
$escaper->escapeUrl
(
$_product->getProductUrl
()) ?>"
class
="
product
photo
product
-
item
-
photo
"
tabindex="
-
1
">
<?php
$productImageRaw
=
$imageHelper->init
(
$_product
,
$imageDisplayArea
)->setImageFile(
$productImage->getFile
())->resize(
$productImage->getWidth
(),
$productImage->getHeight
())->getUrl();
?>
<img
class="
product
-
image
-
photo
" src="
<?=
$productImageRaw
?>
" loading="lazy" width="
<?=
$productImage
->
getWidth
()
?>
" height="
<?=
$productImage
->
getHeight
()
?>
" alt="Image"
>
<img
class="
product
-
image
-
photo
" style="
background
-
color
:
#F0F0F0;border: none;" data-src="<?= $productImageRaw ?>" loading="lazy" width="<?= $productImage->getWidth() ?>px" height="<?= $productImage->getHeight() ?>px" /
>
<?
php
if
(
$hoverImg
)
:
?>
<img
class=
"hoverImg"
width=
"
<?=
$productImage
->
getWidth
()
?>
"
height=
"
<?=
$productImage
->
getHeight
()
?>
"
src=
"
<?=
$hoverImg
?>
"
>
<img
class=
"hoverImg"
width=
"
<?=
$productImage
->
getWidth
()
?>
px"
height=
"
<?=
$productImage
->
getHeight
()
?>
px"
data-src=
"
<?=
$hoverImg
?>
"
loading=
"lazy"
/
>
<?php
endif
;
?>
</a>
<div
class=
"product details product-item-details"
>
...
...
@@ -236,4 +237,44 @@ $_helper = $block->getData('outputHelper');
'item'
:
<?=
json_encode
(
$items
,
true
)
?>
})
</script>
<script>
// 获取所有的图片标签
const
imgs
=
document
.
getElementsByTagName
(
"img"
);
// 获取可视区域的高度
const
viewHeight
=
window
.
innerHeight
||
document
.
documentElement
.
clientHeight
;
// num用于统计当前显示到了哪一张图片,避免每次都从第一张图片开始检查是否露出
let
num
=
0
;
function
lazyload
()
{
for
(
let
i
=
num
;
i
<
imgs
.
length
;
i
++
)
{
// 用可视区域高度减去元素顶部距离可视区域顶部的高度
let
distance
=
viewHeight
-
imgs
[
i
].
getBoundingClientRect
().
top
;
// 如果可视区域高度大于等于元素顶部距离可视区域顶部的高度,说明元素露出
if
(
distance
>=
0
)
{
// 给元素写入真实的src,展示图片
imgs
[
i
].
src
=
imgs
[
i
].
getAttribute
(
"data-src"
);
// 前i张图片已经加载完毕,下次从第i+1张开始检查是否露出
num
=
i
+
1
;
}
}
}
// 防抖函数
function
debounce
(
fn
,
delay
=
500
)
{
let
timer
=
null
;
return
function
(...
args
)
{
if
(
timer
)
clearTimeout
(
timer
);
timer
=
setTimeout
(()
=>
{
fn
.
call
(
this
,
args
);
},
delay
);
};
}
// 是的页面初始化是加载首屏图片
window
.
onload
=
lazyload
;
// 监听Scroll事件,为了防止频繁调用,使用防抖函数优化一下
window
.
addEventListener
(
"scroll"
,
debounce
(
lazyload
,
600
),
false
);
</script>
<?php
endif
;
?>
app/design/frontend/Joshine/breeze/Magento_Checkout/layout/checkout_cart_index.xml
View file @
b6498894
...
...
@@ -11,7 +11,7 @@
<referenceBlock
name=
"checkout.cart.crosssell"
remove=
"true"
/>
<referenceBlock
name=
"checkout.cart.summary.title"
remove=
"true"
/>
<referenceBlock
name=
"minicart"
remove=
"true"
/>
<!-- -->
<!-- <referenceBlock name="checkout.cart.totals">-->
...
...
app/design/frontend/Joshine/breeze/Magento_Checkout/templates/cart/item/default.phtml
View file @
b6498894
...
...
@@ -18,6 +18,21 @@ $canApplyMsrp = $helper->isShowBeforeOrderConfirm($product) && $helper->isMinima
$objectManager
=
\Magento\Framework\App\ObjectManager
::
getInstance
();
$mobileDetect
=
$objectManager
->
get
(
\Joshine\Common\Lib\MobileDetect\MobileDetect
::
class
);
$priceBlock
=
$objectManager
->
get
(
\Magento\Catalog\Block\Product\AbstractProduct
::
class
);
$_options
=
$block
->
getOptionList
();
$resource
=
$objectManager
->
get
(
'Magento\Framework\App\ResourceConnection'
);
$connection
=
$resource
->
getConnection
();
foreach
(
$_options
as
$key
=>
$_option
)
{
if
(
$_option
[
'label'
]
!=
'Size'
)
{
$tableName
=
$resource
->
getTableName
(
'eav_attribute_option_value'
);
$sql
=
"Select value FROM "
.
$tableName
.
" where store_id=0 AND option_id="
.
$_option
[
'option_value'
];
}
else
{
$tableName
=
$resource
->
getTableName
(
'eav_attribute_option_swatch'
);
$sql
=
"Select value FROM "
.
$tableName
.
" where store_id=0 AND option_id="
.
$_option
[
'option_value'
];
}
$result
=
$connection
->
fetchRow
(
$sql
);
$_options
[
$key
][
'value'
]
=
$result
[
'value'
];
}
?>
<div
class=
"cart item is_mobile"
>
...
...
@@ -51,43 +66,18 @@ $priceBlock = $objectManager->get(\Magento\Catalog\Block\Product\AbstractProduct
</p>
<!----------------------------item name end------------------------------------->
<!----------------------------item option start--------------------------------->
<?php
if
(
$_options
=
$block
->
getOptionList
()
)
:?>
<?php
if
(
$_options
)
:?>
<
div
class
="
item
-
options
-
meta
">
<?php
$countOpt
= count(
$_options
);
?>
<?php foreach (
$_options
as
$key
=>
$_option
) :?>
<strong style="
font
-
weight
:
600
;
margin
-
right
:
10
px
;
"><?=
$block->escapeHtml
(
$_option['label']
) ?> :</strong>
<span class="
item
-
options
-
line
">
<?php
$objectManager
= \Magento\Framework\App\ObjectManager::getInstance();
$resource
=
$objectManager->get
('Magento\Framework\App\ResourceConnection');
$connection
=
$resource->getConnection
();
?>
<?php if (
$_option['label']
!= 'Size'){ ?>
<?php
$tableName
=
$resource->getTableName
('eav_attribute_option_value');
$sql
= "
Select
*
FROM
" .
$tableName
."
where
store_id
=
0
AND
option_id
=
".
$_option['option_value']
;
$result
=
$connection->fetchRow
(
$sql
);
?>
<?=
$block->escapeHtml
(
$result['value']
) ?>
<?php }else{
$tableName
=
$resource->getTableName
('eav_attribute_option_swatch');
$sql
= "
Select
*
FROM
" .
$tableName
."
where
store_id
=
0
AND
option_id
=
".
$_option['option_value']
;
$result
=
$connection->fetchRow
(
$sql
);
echo
$result['value']
;
} ?>
<?=
$block->escapeHtml
(
$_option['value']
) ?>
</span><br />
<?php endforeach; ?>
</div>
<?php endif;?>
<div style="
max
-
width
:
100
%
;
width
:
100
%
;
height
:
40
px
;
">
<!----------------------------item handle start--------------------------------->
<div class="
item
-
handle
" style="
width
:
16
%
;
float
:
left
;
position
:
inherit
;
font
-
size
:
16
px
;
">
<div class="
item
-
quantity
">
...
...
app/design/frontend/Joshine/breeze/Magento_Theme/layout/default.xml
View file @
b6498894
...
...
@@ -106,7 +106,7 @@
<referenceBlock
name=
"copyright"
remove=
"true"
/>
</referenceContainer>
<referenceContainer
name=
"before.body.end"
>
<block
class=
"Magento\Theme\Block\Html\Footer"
name=
"footer"
template=
"Magento_Theme::html/footer.phtml"
/>
<block
class=
"Magento\Theme\Block\Html\Footer"
name=
"footer"
template=
"Magento_Theme::html/footer.phtml"
cacheable=
"true"
/>
</referenceContainer>
<referenceContainer
name=
"content"
>
<block
class=
"Magento\Framework\View\Element\FormKey"
name=
"formkey"
/>
...
...
app/design/frontend/Joshine/breeze/Magento_Theme/templates/html/footer.phtml
View file @
b6498894
...
...
@@ -3,21 +3,11 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
?>
<?php
echo
$block
->
getLayout
()
->
createBlock
(
'Magento\Cms\Block\Block'
)
->
setBlockId
(
'public_footer'
)
->
toHtml
();
?>
<p
title=
"go to header"
id=
"topBtn"
style=
"display: none;"
>
<img
loading=
"lazy"
src=
"
<?php
echo
$block
->
getViewFileUrl
(
'images/goTop.png'
);
?>
"
>
</p>
<script>
var
userAgentInfo
=
navigator
.
userAgent
;
var
Agents
=
new
Array
(
"Android"
,
"iPhone"
,
"SymbianOS"
,
"Windows Phone"
,
"iPad"
,
"iPod"
);
var
flag
=
true
;
for
(
var
v
=
0
;
v
<
Agents
.
length
;
v
++
)
{
if
(
userAgentInfo
.
indexOf
(
Agents
[
v
])
>
0
)
{
flag
=
false
;
break
;
}
}
require
([
'jquery'
],
function
(
$
){
var
flag
=
window
.
matchMedia
(
"(pointer:coarse)"
).
matches
;
//footer
$
(
"h4"
).
click
(
function
()
{
var
dis
=
$
(
this
).
siblings
(
"ul"
).
css
(
"display"
);
...
...
@@ -36,6 +26,22 @@
$
(
"#search_mini_form_input"
).
toggle
();
});
//auto logo height
if
(
flag
){
var
imgH
=
$
(
'.logo'
).
height
();
imgH
=
Math
.
ceil
(
imgH
/
3
);
$
(
'.header '
).
css
(
'margin-bottom'
,
imgH
);
}
else
{
//var headerH = $('.page-header').outerHeight(true);
$
(
'.columns'
).
css
(
'margin-top'
,
0
);
}
//free shipping bar not existent
if
(
!
flag
&&
!
$
(
'.sparsh-free-shipping-bar-goal-message'
).
length
){
$
(
'.page-header'
).
css
(
'margin-top'
,
'0'
);
}
if
(
flag
){
...
...
app/design/frontend/Joshine/breeze/Magento_Theme/templates/html/header/logo.phtml
View file @
b6498894
...
...
@@ -19,40 +19,6 @@ $logoHeight = $logoSizeResolver !== null && $logoSizeResolver->getHeight()
?
$logoSizeResolver
->
getHeight
()
:
$block
->
getLogoHeight
();
?>
<script>
var
userAgentInfo
=
navigator
.
userAgent
;
var
Agents
=
new
Array
(
"Android"
,
"iPhone"
,
"SymbianOS"
,
"Windows Phone"
,
"iPad"
,
"iPod"
);
var
flag
=
true
;
for
(
var
v
=
0
;
v
<
Agents
.
length
;
v
++
)
{
if
(
userAgentInfo
.
indexOf
(
Agents
[
v
])
>
0
)
{
flag
=
false
;
break
;
}
}
require
([
'jquery'
],
function
(
$
){
//free shipping bar not existent
if
(
!
flag
&&
!
$
(
'.sparsh-free-shipping-bar-goal-message'
).
length
){
$
(
'.page-header'
).
css
(
'margin-top'
,
'0'
);
}
//auto logo height
if
(
flag
){
var
imgH
=
$
(
'.logo'
).
height
();
imgH
=
Math
.
ceil
(
imgH
/
3
);
$
(
'.header '
).
css
(
'margin-bottom'
,
imgH
);
}
else
{
//var headerH = $('.page-header').outerHeight(true);
$
(
'.columns'
).
css
(
'margin-top'
,
0
);
}
});
</script>
<style>
.secure-span
{
display
:
none
;
...
...
@@ -64,12 +30,12 @@ $logoHeight = $logoSizeResolver !== null && $logoSizeResolver->getHeight()
href=
"
<?=
$block
->
escapeUrl
(
$block
->
getUrl
(
''
))
?>
"
title=
"
<?=
$block
->
escapeHtmlAttr
(
$storeName
)
?>
"
aria-label=
"store logo"
>
<img
class=
"site-logo"
src=
"
<?=
$block
->
escapeUrl
(
$block
->
getLogoSrc
())
?>
"
<img
class=
"site-logo"
data-src=
"
<?=
$block
->
escapeUrl
(
$block
->
getLogoSrc
())
?>
"
src=
"
<?=
$block
->
escapeUrl
(
$block
->
getLogoSrc
())
?>
"
title=
"
<?=
$block
->
escapeHtmlAttr
(
$block
->
getLogoAlt
())
?>
"
alt=
"
<?=
$block
->
escapeHtmlAttr
(
$block
->
getLogoAlt
())
?>
"
<?=
$logoWidth
?
'width="'
.
$block
->
escapeHtmlAttr
(
$logoWidth
)
.
'"'
:
''
?>
<?=
$logoHeight
?
'height="'
.
$block
->
escapeHtmlAttr
(
$logoHeight
)
.
'"'
:
''
?>
/>
loading=
"lazy"
/>
<span
class=
"secure-span"
>
<span
class=
"cut-span"
>
/
...
...
app/design/frontend/Joshine/breeze/web/css/_custom.less
View file @
b6498894
...
...
@@ -3093,7 +3093,7 @@ strong.subtitle.empty{
margin-right: 1rem;
}
.minicart-items .price-container{
font-size: 1
2
px;
font-size: 1
8
px;
}
button.action.primary.checkout{
height: 50px;
...
...
@@ -3424,7 +3424,7 @@ div#shipping-method-buttons-container {
}
span.qty-wrapper {
font-size: 1
2
px;
font-size: 1
8
px;
}
.checkout-container .action.primary, .checkout-container action.secondary{
background-color: #ffa800 !important;
...
...
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