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
ab1fea12
Commit
ab1fea12
authored
Mar 03, 2023
by
wd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分类隐藏size弹出按钮
parent
47cb16ba
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
2 deletions
+62
-2
app/code/Joshine/Category/Setup/UpgradeData.php
+14
-0
app/code/Joshine/Category/etc/module.xml
+1
-1
app/code/Joshine/Category/view/adminhtml/ui_component/category_form.xml
+35
-1
app/design/frontend/Joshine/breeze/Magento_Catalog/templates/product/view/addtocart.phtml
+12
-0
No files found.
app/code/Joshine/Category/Setup/UpgradeData.php
View file @
ab1fea12
...
...
@@ -104,6 +104,20 @@ class UpgradeData implements UpgradeDataInterface
'required'
=>
false
,
'sort_order'
=>
70
,
'global'
=>
\Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface
::
SCOPE_STORE
,
],
'is_show_size'
=>
[
'type'
=>
'int'
,
'label'
=>
'badge'
,
'visible_on_front'
=>
true
,
'user_defined'
=>
false
,
'default'
=>
0
,
'group'
=>
''
,
'input'
=>
'checkbox'
,
'backend'
=>
''
,
'required'
=>
false
,
'sort_order'
=>
100
,
'global'
=>
\Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface
::
SCOPE_STORE
,
]
];
...
...
app/code/Joshine/Category/etc/module.xml
View file @
ab1fea12
...
...
@@ -6,5 +6,5 @@
*/
-->
<config
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation=
"urn:magento:framework:Module/etc/module.xsd"
>
<module
name=
"Joshine_Category"
setup_version=
"1.1.
2
"
/>
<module
name=
"Joshine_Category"
setup_version=
"1.1.
5
"
/>
</config>
app/code/Joshine/Category/view/adminhtml/ui_component/category_form.xml
View file @
ab1fea12
...
...
@@ -84,5 +84,39 @@
</argument>
</field>
</fieldset>
</form>
<fieldset
name=
"general"
>
<field
name=
"is_show_size"
sortOrder=
"0"
formElement=
"checkbox"
>
<argument
name=
"data"
xsi:type=
"array"
>
<item
name=
"config"
xsi:type=
"array"
>
<item
name=
"source"
xsi:type=
"string"
>
category
</item>
<item
name=
"default"
xsi:type=
"number"
>
0
</item>
</item>
</argument>
<settings>
<validation>
<rule
name=
"required-entry"
xsi:type=
"boolean"
>
false
</rule>
</validation>
<dataType>
boolean
</dataType>
<label
translate=
"true"
>
Is Show Size
</label>
</settings>
<formElements>
<checkbox>
<settings>
<valueMap>
<map
name=
"false"
xsi:type=
"string"
>
0
</map>
<map
name=
"true"
xsi:type=
"string"
>
1
</map>
</valueMap>
<prefer>
toggle
</prefer>
</settings>
</checkbox>
</formElements>
</field>
</fieldset>
</form>
app/design/frontend/Joshine/breeze/Magento_Catalog/templates/product/view/addtocart.phtml
View file @
ab1fea12
...
...
@@ -55,7 +55,19 @@
max-width
:
100%
;
font-weight
:
600
;
}
<?php
$objectManager
=
\Magento\Framework\App\ObjectManager
::
getInstance
();
$categoryId
=
$_product
->
getCategoryIds
();
foreach
(
$categoryId
as
$value
){
$category
=
$objectManager
->
create
(
'Magento\Catalog\Model\Category'
)
->
load
(
$value
);
if
(
$category
->
getIsShowSize
()
==
1
){
echo
'#product-intro__freeshipping-more-3{display:none!important}'
;
}
}
?>
</style>
<script>
require
([
'jquery'
...
...
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