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
527fcd8f
Commit
527fcd8f
authored
May 18, 2023
by
dhn
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://47.99.244.21:9999/root/joshine
into Branchs_developer
parents
05e99940
0eaca49c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
66 additions
and
26 deletions
+66
-26
app/code/Magepow/Sizechart/Block/Adminhtml/Sizechart/Edit/Tab/Main.php
+1
-1
app/code/Magepow/Sizechart/etc/acl.xml
+0
-19
app/design/frontend/Joshine/breeze/Magento_Catalog/templates/product/view/addtocart.phtml
+30
-5
app/design/frontend/Joshine/breeze/Magento_Swatches/web/js/swatch-renderer.js
+35
-1
No files found.
app/code/Magepow/Sizechart/Block/Adminhtml/Sizechart/Edit/Tab/Main.php
View file @
527fcd8f
...
@@ -146,7 +146,7 @@ class Main extends Generic implements TabInterface
...
@@ -146,7 +146,7 @@ class Main extends Generic implements TabInterface
'chart_table'
,
'chart_table'
,
[
[
'name'
=>
'chart_table'
,
'name'
=>
'chart_table'
,
'label'
=>
__
(
'Chart Table(英尺)'
),
'label'
=>
__
(
'Chart Table(英尺
,范围值用-分隔
)'
),
'id'
=>
'chart_table'
,
'id'
=>
'chart_table'
,
'title'
=>
__
(
'Chart Table'
),
'title'
=>
__
(
'Chart Table'
),
'required'
=>
false
,
'required'
=>
false
,
...
...
app/code/Magepow/Sizechart/etc/acl.xml
deleted
100644 → 0
View file @
05e99940
<config
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation=
"urn:magento:framework:Acl/etc/acl.xsd"
>
<acl>
<resources>
<resource
id=
"Magento_Backend::admin"
>
<resource
id=
"Magepow_Sizechart::magepow"
title=
"Size Chart"
sortOrder=
"10"
>
<resource
id=
"Magepow_Sizechart::sizechart"
title=
"Size Chart Management"
sortOrder=
"50"
/>
</resource>
<resource
id=
"Magento_Backend::stores"
>
<resource
id=
"Magento_Backend::stores_settings"
>
<resource
id=
"Magento_Config::config"
>
<resource
id=
"Magepow_Sizechart::config"
title=
"Size Chart"
/>
</resource>
</resource>
</resource>
</resource>
</resources>
</acl>
</config>
\ No newline at end of file
app/design/frontend/Joshine/breeze/Magento_Catalog/templates/product/view/addtocart.phtml
View file @
527fcd8f
...
@@ -302,6 +302,9 @@
...
@@ -302,6 +302,9 @@
}
}
$
(
'.chart-size-switch-item'
).
click
(
function
(
data
)
{
$
(
'.chart-size-switch-item'
).
click
(
function
(
data
)
{
if
(
$
(
this
).
hasClass
(
'-active'
))
{
if
(
$
(
this
).
hasClass
(
'-active'
))
{
return
;
return
;
}
}
...
@@ -314,12 +317,34 @@
...
@@ -314,12 +317,34 @@
}
}
$
.
each
(
$
(
".size-item"
),
function
(
x
)
{
$
.
each
(
$
(
".size-item"
),
function
(
x
)
{
var
current
=
$
(
this
).
data
(
'size-item-inc'
);
var
current
=
$
(
this
).
data
(
'size-item-inc'
);
if
(
currentType
==
'inc'
&&
type
==
'cm'
)
{
if
(
typeof
(
current
)
==
"number"
)
{
var
data
=
(
current
*
percent
-
0
).
toFixed
(
2
);
if
(
currentType
==
'inc'
&&
type
==
'cm'
)
{
}
else
{
var
data
=
(
current
*
percent
-
0
).
toFixed
(
2
);
var
data
=
$
(
this
).
data
(
'size-item-inc'
);
}
else
{
var
data
=
$
(
this
).
data
(
'size-item-inc'
);
}
$
(
this
).
html
(
data
);
}
else
if
(
typeof
(
current
)
==
"string"
&&
current
.
indexOf
(
"-"
)
!=
-
1
)
{
var
data
=
current
.
split
(
"-"
);
if
(
data
.
length
==
0
)
{
return
;
}
let
tmp
=
new
Array
();
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
)
{
var
currentSizeFloat
=
data
[
i
];
if
(
currentType
==
'inc'
&&
type
==
'cm'
)
{
var
res
=
(
currentSizeFloat
*
percent
-
0
).
toFixed
(
2
);
tmp
.
push
(
res
);
}
else
{
var
res
=
$
(
this
).
data
(
'size-item-inc'
);
tmp
=
res
;
}
}
if
(
tmp
instanceof
Array
)
{
tmp
=
tmp
.
join
(
'-'
);
}
$
(
this
).
html
(
tmp
);
}
}
$
(
this
).
html
(
data
);
});
});
});
});
...
...
app/design/frontend/Joshine/breeze/Magento_Swatches/web/js/swatch-renderer.js
View file @
527fcd8f
...
@@ -427,11 +427,45 @@ define([
...
@@ -427,11 +427,45 @@ define([
label
+=
currentItem
[
i
]
+
" : "
;
label
+=
currentItem
[
i
]
+
" : "
;
continue
;
continue
;
}
}
/*单位转换代码,预留待用
if (typeof(currentItem[i]) == "string") {
label += dealLabel(option[i], currentItem[i]);
} else {
label += option[i] + ' ' + currentItem[i] +"("+getCurrentType()+") ";
}*/
label
+=
option
[
i
]
+
' '
+
currentItem
[
i
]
+
"(inc) "
;
label
+=
option
[
i
]
+
' '
+
currentItem
[
i
]
+
"(inc) "
;
if
(
i
<
labelLen
-
1
)
{
if
(
i
<
labelLen
-
1
)
{
label
+=
", "
;
label
+=
", "
;
}
}
}
}
function
getCurrentType
()
{
var
type
=
$
(
".chart-size-switch-item.-active"
).
data
(
"size-type"
);
return
type
;
}
function
dealLabel
(
option
,
current
)
{
var
percent
=
2.54
;
var
data
=
current
.
split
(
"-"
);
if
(
data
.
length
==
0
)
{
return
" "
;
}
var
currentType
=
getCurrentType
();
if
(
currentType
==
'inc'
)
{
return
option
+
' '
+
currentItem
+
"(inc) "
;
}
let
tmp
=
[];
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
var
res
=
(
data
[
i
]
*
percent
-
0
).
toFixed
(
2
);
tmp
.
push
(
res
);
}
if
(
tmp
instanceof
Array
)
{
tmp
=
tmp
.
join
(
'-'
);
}
return
option
+
' '
+
tmp
+
"(cm) "
;
}
return
label
;
return
label
;
},
},
...
@@ -568,7 +602,7 @@ define([
...
@@ -568,7 +602,7 @@ define([
listLabel
=
''
,
listLabel
=
''
,
label
=
''
;
label
=
''
;
if
(
item
.
code
==
"size"
)
{
if
(
item
.
code
==
"size"
)
{
var
options
=
$widget
.
_RenderSwatchWithCustomerOptions
(
item
,
controlLabelId
);
var
options
=
$widget
.
_RenderSwatchWithCustomerOptions
(
item
,
controlLabelId
);
}
else
{
}
else
{
var
options
=
$widget
.
_RenderSwatchOptions
(
item
,
controlLabelId
);
var
options
=
$widget
.
_RenderSwatchOptions
(
item
,
controlLabelId
);
...
...
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