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
f498618c
Commit
f498618c
authored
May 18, 2023
by
halweg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
bf54c030
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
15 deletions
+36
-15
app/code/Magepow/Sizechart/Block/Adminhtml/Sizechart/Edit/Tab/Main.php
+14
-2
app/code/Magepow/Sizechart/Block/Adminhtml/Sizechart/Edit/Tabs.php
+2
-2
app/code/Magepow/Sizechart/Block/Product/Sizechart.php
+18
-7
app/code/Magepow/Sizechart/Controller/Adminhtml/Sizechart/Save.php
+0
-4
app/design/frontend/Joshine/breeze/Magento_Swatches/web/js/swatch-renderer.js
+2
-0
No files found.
app/code/Magepow/Sizechart/Block/Adminhtml/Sizechart/Edit/Tab/Main.php
View file @
f498618c
...
@@ -114,8 +114,8 @@ class Main extends Generic implements TabInterface
...
@@ -114,8 +114,8 @@ class Main extends Generic implements TabInterface
'name'
=>
'sizechart_info'
,
'name'
=>
'sizechart_info'
,
'label'
=>
__
(
'Size Chart Information'
),
'label'
=>
__
(
'Size Chart Information'
),
'wysiwyg'
=>
true
,
'wysiwyg'
=>
true
,
'
config'
=>
$this
->
_wysiwygConfig
->
getConfig
()
,
'
required'
=>
true
,
'
required'
=>
true
'
config'
=>
$wysiwygConfig
]
]
);
);
...
@@ -154,6 +154,18 @@ class Main extends Generic implements TabInterface
...
@@ -154,6 +154,18 @@ class Main extends Generic implements TabInterface
);
);
$fieldset
->
addField
(
$fieldset
->
addField
(
'category'
,
'text'
,
[
'name'
=>
'category'
,
'label'
=>
__
(
'分类ID(多个用,隔开不要空格)'
),
'id'
=>
'category'
,
'title'
=>
__
(
'分类ID(多个用,隔开不要空格)'
),
'required'
=>
false
,
]
);
$fieldset
->
addField
(
'type_display'
,
'type_display'
,
'hidden'
,
'hidden'
,
[
[
...
...
app/code/Magepow/Sizechart/Block/Adminhtml/Sizechart/Edit/Tabs.php
View file @
f498618c
...
@@ -34,7 +34,7 @@ class Tabs extends WidgetTabs
...
@@ -34,7 +34,7 @@ class Tabs extends WidgetTabs
)
->
toHtml
(),
)
->
toHtml
(),
]
]
);
);
$this
->
addTab
(
/*
$this->addTab(
'category',
'category',
[
[
'label' => __('Condition apply for products'),
'label' => __('Condition apply for products'),
...
@@ -43,7 +43,7 @@ class Tabs extends WidgetTabs
...
@@ -43,7 +43,7 @@ class Tabs extends WidgetTabs
'Magepow\Sizechart\Block\Adminhtml\Sizechart\Edit\Tab\Condition'
'Magepow\Sizechart\Block\Adminhtml\Sizechart\Edit\Tab\Condition'
)->toHtml(),
)->toHtml(),
]
]
);
);
*/
return
parent
::
_beforeToHtml
();
return
parent
::
_beforeToHtml
();
}
}
...
...
app/code/Magepow/Sizechart/Block/Product/Sizechart.php
View file @
f498618c
...
@@ -68,19 +68,30 @@ class Sizechart extends \Magento\Catalog\Block\Product\AbstractProduct
...
@@ -68,19 +68,30 @@ class Sizechart extends \Magento\Catalog\Block\Product\AbstractProduct
$product
=
$this
->
getProduct
();
$product
=
$this
->
getProduct
();
$sizeChart
=
''
;
$sizeChart
=
''
;
foreach
(
$collection
as
$item
)
{
foreach
(
$collection
as
$item
)
{
$config
=
$item
->
getConditionsSerialized
();
//
$config = $item->getConditionsSerialized();
$data
=
$this
->
json
->
unserialize
(
$config
);
//
$data = $this->json->unserialize($config);
$parameters
=
$data
[
'parameters'
];
//
$parameters = $data['parameters'];
$rule
=
$this
->
getRule
(
$parameters
);
//
$rule = $this->getRule($parameters);
$validate
=
$rule
->
getConditions
()
->
validate
(
$product
);
//
$validate = $rule->getConditions()->validate($product);
if
(
$validate
)
{
/*
if ($validate) {
$sizeChart = $item;
$sizeChart = $item;
break;
break;
}*/
$category
=
$item
->
getCategory
();
if
(
empty
(
$category
))
{
continue
;
}
}
}
$categoryIds
=
explode
(
','
,
$category
);
$pids
=
$product
->
getCategoryIds
();
if
(
count
(
array_intersect
(
$categoryIds
,
$pids
))
>
0
)
{
$sizeChart
=
$item
;
break
;
}
}
$this
->
setData
(
'size_chart'
,
$sizeChart
);
$this
->
setData
(
'size_chart'
,
$sizeChart
);
}
}
return
$this
->
getData
(
'size_chart'
);
return
$this
->
getData
(
'size_chart'
);
}
}
...
...
app/code/Magepow/Sizechart/Controller/Adminhtml/Sizechart/Save.php
View file @
f498618c
...
@@ -38,10 +38,6 @@ class Save extends \Magento\Backend\App\Action
...
@@ -38,10 +38,6 @@ class Save extends \Magento\Backend\App\Action
return
$resultRedirect
->
setPath
(
'*/*/'
);
return
$resultRedirect
->
setPath
(
'*/*/'
);
}
}
if
(
isset
(
$data
[
'category'
]))
{
$data
[
'category'
]
=
implode
(
','
,
$data
[
'category'
]);
}
$data
[
'conditions_serialized'
]
=
$this
->
serialize
([
'parameters'
=>
$data
[
'parameters'
]]);
$data
[
'conditions_serialized'
]
=
$this
->
serialize
([
'parameters'
=>
$data
[
'parameters'
]]);
if
(
isset
(
$data
[
'custom_size'
]))
{
if
(
isset
(
$data
[
'custom_size'
]))
{
...
...
app/design/frontend/Joshine/breeze/Magento_Swatches/web/js/swatch-renderer.js
View file @
f498618c
...
@@ -213,6 +213,8 @@ define([
...
@@ -213,6 +213,8 @@ define([
// option's json config
// option's json config
jsonConfig
:
{},
jsonConfig
:
{},
sizeChartData
:
{},
// swatch's json config
// swatch's json config
jsonSwatchConfig
:
{},
jsonSwatchConfig
:
{},
...
...
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