Commit ab1fea12 by wd

分类隐藏size弹出按钮

parent 47cb16ba
......@@ -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,
]
];
......
......@@ -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>
......@@ -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>
......@@ -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'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment