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
82ff69b7
Commit
82ff69b7
authored
Feb 21, 2023
by
wd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复ui组件重复以及数据未过滤问题
parent
32b3fca9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
8 deletions
+15
-8
app/code/Sparsh/FreeShippingBar/Helper/Data.php
+2
-2
app/code/Sparsh/FreeShippingBar/view/frontend/templates/free_shipping_bar.phtml
+13
-6
No files found.
app/code/Sparsh/FreeShippingBar/Helper/Data.php
View file @
82ff69b7
...
@@ -122,8 +122,8 @@ class Data extends AbstractHelper
...
@@ -122,8 +122,8 @@ class Data extends AbstractHelper
if
(
$collection
->
getData
())
{
if
(
$collection
->
getData
())
{
foreach
(
$collection
as
$barItem
)
{
foreach
(
$collection
as
$barItem
)
{
if
(
$this
->
isStoreMatched
(
$barItem
[
'store_id'
])
&&
if
(
$this
->
isStoreMatched
(
$barItem
[
'store_id'
])
&&
$this
->
isCustomerGroupMatched
(
$barItem
[
'customer_group_id'
]))
{
$this
->
isCustomerGroupMatched
(
$barItem
[
'customer_group_id'
])
&&
$barItem
->
getData
(
'bar_layout_position'
)
!=
'insert_snippet'
)
{
return
$barItem
->
getData
();
return
$barItem
->
getData
();
}
}
}
}
}
}
...
...
app/code/Sparsh/FreeShippingBar/view/frontend/templates/free_shipping_bar.phtml
View file @
82ff69b7
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
<?php
<?php
$isModuleEnable
=
$block
->
getConfig
(
'sparsh_free_shipping_bar/general/enable'
);
$isModuleEnable
=
$block
->
getConfig
(
'sparsh_free_shipping_bar/general/enable'
);
$isFreeShippingBarAvailable
=
null
;
$isFreeShippingBarAvailable
=
null
;
if
(
$isModuleEnable
)
:
if
(
$isModuleEnable
)
:
$layoutPosition
=
$block
->
getData
(
'position'
)
?
$block
->
getData
(
'position'
)
:
null
;
$layoutPosition
=
$block
->
getData
(
'position'
)
?
$block
->
getData
(
'position'
)
:
null
;
$entityId
=
$block
->
getData
(
'entity_id'
)
?
$block
->
getData
(
'entity_id'
)
:
null
;
$entityId
=
$block
->
getData
(
'entity_id'
)
?
$block
->
getData
(
'entity_id'
)
:
null
;
...
@@ -28,15 +29,18 @@ endif;
...
@@ -28,15 +29,18 @@ endif;
.sparsh-free-shipping-bar-goal-message
{
.sparsh-free-shipping-bar-goal-message
{
width
:
100%
;
width
:
100%
;
height
:
60px
;
height
:
60px
;
background-image
:
url
(
"
<?=
$block
->
getImgUrl
(
$barData
[
'background_img'
])
?>
");
line-height
:
60px
;
line-height
:
60px
;
background-size
:
100%
100%
!important
;
background-size
:
100%
100%
!important
;
background-repeat
:
no-repeat
;
background-repeat
:
no-repeat
;
text-align
:
center
;
}
.sparsh-free-shipping-bar-goal-message-back-
<?=
$barData
[
'entity_id'
];
?>
{
background-image
:
url
(
'
<?=
$block
->
getImgUrl
(
$barData
[
'background_img'
])
?>
'
);
}
}
@media
(
max-width
:
768px
)
{
@media
(
max-width
:
768px
)
{
.sparsh-free-shipping-bar-goal-message
{
.sparsh-free-shipping-bar-goal-message
{
background-image: url("
<?=
$block
->
getImgUrl
(
$barData
[
'background_img_phone'
])
?>
"
);
width
:
100%
;
width
:
100%
;
height
:
40px
;
height
:
40px
;
line-height
:
40px
;
line-height
:
40px
;
...
@@ -44,14 +48,17 @@ endif;
...
@@ -44,14 +48,17 @@ endif;
background-repeat
:
no-repeat
;
background-repeat
:
no-repeat
;
}
}
.sparsh-free-shipping-bar-goal-message-back-
<?=
$barData
[
'entity_id'
];
?>
{
background-image
:
url
(
'
<?=
$block
->
getImgUrl
(
$barData
[
'background_img_phone'
])
?>
'
);
}
}
}
</style>
</style>
<div
class=
"sparsh-free-shipping-bar-goal-message"
<div
class=
"sparsh-free-shipping-bar-goal-message
sparsh-free-shipping-bar-goal-message-back-
<?=
$barData
[
'entity_id'
];
?>
"
style=
"
background-size: 100%; text-align: center;
background-color:
<?=
/* @noEscape */
$barData
[
'bar_background_color'
]
?>
; font-size:
<?=
/* @noEscape */
$barData
[
'bar_font_size'
]
.
'px'
?>
"
>
style=
" background-color:
<?=
/* @noEscape */
$barData
[
'bar_background_color'
]
?>
; font-size:
<?=
/* @noEscape */
$barData
[
'bar_font_size'
]
.
'px'
?>
"
>
<a
<?=
/* @noEscape */
$barData
[
'is_clickable'
]
?
'href='
.
$barData
[
'bar_link_url'
]
:
null
?>
<a
<?=
/* @noEscape */
$barData
[
'is_clickable'
]
?
'href='
.
$barData
[
'bar_link_url'
]
:
null
?>
<?=
/* @noEscape */
$barData
[
'is_clickable'
]
?
(
$barData
[
'is_link_open_in_new_page'
]
?
'target=_blank'
:
'target=_self'
)
:
null
?>
<?=
/* @noEscape */
$barData
[
'is_clickable'
]
?
(
$barData
[
'is_link_open_in_new_page'
]
?
'target=_blank'
:
'target=_self'
)
:
null
?>
style=
"width: 100%;height: 100%; display: block; color:
<?=
/* @noEscape */
$barData
[
'bar_text_color'
]
?>
"
>
style=
"width: 100%;height: 100%; display: block; color:
<?=
/* @noEscape */
$barData
[
'bar_text_color'
]
?>
"
>
<div
data-bind=
"scope: 'free-shipping-scope'"
>
<div
data-bind=
"scope: 'free-shipping-scope
<?=
$barData
[
'entity_id'
];
?>
'"
>
<p
data-bind=
"html: goalMessage"
></p>
<p
data-bind=
"html: goalMessage"
></p>
</div>
</div>
</a>
</a>
...
@@ -61,7 +68,7 @@ endif;
...
@@ -61,7 +68,7 @@ endif;
"*"
:
{
"*"
:
{
"Magento_Ui/js/core/app"
:
{
"Magento_Ui/js/core/app"
:
{
"components"
:
{
"components"
:
{
"free-shipping-scope"
:
{
"free-shipping-scope
<?=
$barData
[
'entity_id'
];
?>
"
:
{
"component"
:
"Sparsh_FreeShippingBar/js/free_shipping_bar"
,
"component"
:
"Sparsh_FreeShippingBar/js/free_shipping_bar"
,
"goal"
:
"
<?=
/* @noEscape */
$barData
[
'goal'
]
?>
"
,
"goal"
:
"
<?=
/* @noEscape */
$barData
[
'goal'
]
?>
"
,
"currency"
:
"
<?=
/* @noEscape */
$block
->
getCurrentCurrencySymbol
()
?>
"
,
"currency"
:
"
<?=
/* @noEscape */
$block
->
getCurrentCurrencySymbol
()
?>
"
,
...
...
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