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
52f451f1
Commit
52f451f1
authored
May 17, 2023
by
halweg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
size
parent
5b86335a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
10 deletions
+19
-10
app/code/Magepow/Sizechart/Block/Adminhtml/Sizechart/Edit/Tab/Main.php
+4
-4
app/code/Magepow/Sizechart/Block/Product/Sizechart.php
+2
-1
app/design/frontend/Joshine/breeze/Magento_Catalog/templates/product/view/addtocart.phtml
+2
-2
app/design/frontend/Joshine/breeze/Magento_Swatches/web/js/swatch-renderer.js
+11
-3
No files found.
app/code/Magepow/Sizechart/Block/Adminhtml/Sizechart/Edit/Tab/Main.php
View file @
52f451f1
...
...
@@ -146,7 +146,7 @@ class Main extends Generic implements TabInterface
'chart_table'
,
[
'name'
=>
'chart_table'
,
'label'
=>
__
(
'Chart Table'
),
'label'
=>
__
(
'Chart Table
(英尺)
'
),
'id'
=>
'chart_table'
,
'title'
=>
__
(
'Chart Table'
),
'required'
=>
false
,
...
...
@@ -155,14 +155,14 @@ class Main extends Generic implements TabInterface
$fieldset
->
addField
(
'type_display'
,
'
select
'
,
'
hidden
'
,
[
'name'
=>
'type_display'
,
'label'
=>
__
(
'Type Display'
),
'id'
=>
'type_display'
,
'title'
=>
__
(
'Type Display'
),
'value
s'
=>
$this
->
_typeDisplay
->
getOptionArray
()
,
'required'
=>
tru
e
,
'value
'
=>
1
,
'required'
=>
fals
e
,
]
);
...
...
app/code/Magepow/Sizechart/Block/Product/Sizechart.php
View file @
52f451f1
...
...
@@ -134,6 +134,6 @@ class Sizechart extends \Magento\Catalog\Block\Product\AbstractProduct
$chartTable
=
$sizeChart
->
getData
(
'custom_size'
);
$chartTableArray
=
$chartTable
;
}
return
json_encode
(
$chartTableArray
,
true
);
return
json_encode
(
[]
,
true
);
}
}
\ No newline at end of file
app/design/frontend/Joshine/breeze/Magento_Catalog/templates/product/view/addtocart.phtml
View file @
52f451f1
...
...
@@ -300,7 +300,6 @@
var
percent
=
2.54
;
$
.
each
(
$
(
".size-item"
),
function
(
x
)
{
var
current
=
$
(
this
).
data
(
'size-item-cm'
);
console
.
log
(
current
);
if
(
type
==
'inc'
)
{
var
data
=
(
current
/
percent
-
0
).
toFixed
(
2
);
}
else
{
...
...
@@ -324,7 +323,8 @@
<div
id=
"chart-details"
>
<div
class=
"chart-size-switch "
>
<input
type=
"hidden"
value=
""
>
<span
class=
"chart-size-switch-item -active"
data-size-type=
"cm"
>
<?=
__
(
'cm'
);
?>
</span><span
data-size-type=
"inc"
class=
"chart-size-switch-item"
>
<?=
__
(
'Inch'
);
?>
</span>
<span
data-size-type=
"inc"
class=
"chart-size-switch-item -active"
>
<?=
__
(
'Inch'
);
?>
</span>
<span
class=
"chart-size-switch-item "
data-size-type=
"cm"
>
<?=
__
(
'cm'
);
?>
</span>
</div>
<!--全局table已被污染,请使用div模拟表格-->
<div
class=
"table"
id=
"fme_sizechart_table"
style=
"display: table;"
>
...
...
app/design/frontend/Joshine/breeze/Magento_Swatches/web/js/swatch-renderer.js
View file @
52f451f1
...
...
@@ -398,6 +398,9 @@ define([
_getSizeChartData
:
function
(
item
,
value
)
{
var
chartData
=
this
.
options
.
sizeChartData
;
if
(
chartData
.
length
==
0
)
{
return
''
;
}
chartData
=
JSON
.
parse
(
chartData
);
var
len
=
chartData
.
length
var
currentItem
=
[];
...
...
@@ -422,7 +425,7 @@ define([
label
+=
currentItem
[
i
]
+
" : "
;
continue
;
}
label
+=
option
[
i
]
+
' '
+
currentItem
[
i
]
+
"(
cm)
"
;
label
+=
option
[
i
]
+
' '
+
currentItem
[
i
]
+
"(
inc)
"
;
if
(
i
<
labelLen
-
1
)
{
label
+=
", "
;
}
...
...
@@ -600,8 +603,13 @@ define([
}
if
(
item
.
id
==
137
)
{
// Create new control
var
sizeContent
=
'<div class="swatch-attribute-selected-option-size-content" style="display:block;">'
+
'<span class="'
+
classes
.
attributeSelectedOptionLabelClass
+
'">'
+
that
.
_getSizeChartData
(
item
,
optionConfig
[
137
][
item
.
options
[
0
].
id
].
value
)
+
'</span></div>'
;
var
sizeContentText
=
that
.
_getSizeChartData
(
item
,
optionConfig
[
137
][
item
.
options
[
0
].
id
].
value
);
var
sizeContent
=
''
;
if
(
sizeContentText
.
length
>
0
)
{
sizeContent
+=
'<div class="swatch-attribute-selected-option-size-content" style="display:block;">'
;
sizeContent
+=
'<span class="'
+
classes
.
attributeSelectedOptionLabelClass
+
'">'
+
that
.
_getSizeChartData
(
item
,
optionConfig
[
137
][
item
.
options
[
0
].
id
].
value
)
+
'</span>'
;
sizeContent
+=
"</div>"
;
}
container
.
append
(
'<div class="'
+
classes
.
attributeClass
+
' '
+
item
.
code
+
'" '
+
...
...
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