在woocommerce产品类型中隐藏选项选择项 [英] Hide option select item in woocommerce product type

查看:257
本文介绍了在woocommerce产品类型中隐藏选项选择项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正计划向某人提供woocommerce商店,并且我希望不隐藏任何基本选项,以免混淆高级用户。尤其是产品类型。

I am planning to deliver a woocommerce shop to someone and I want to hide none essential options in order not to confuse non advance users. Particularly Product type.

在WooCommerce产品编辑器中,有一个选择产品类型的选项。我只想显示简单且可变的产品。

In WooCommerce Product Editor, there is an option to select product type. I only want to show Simple and variable product.

通常这可以使用CSS display:hide属性来完成,但是当我检查woocommerce产品选项select时,这些选项没有id或类选择器。

Normally this could be done using css display:hide attributes but when I inspect woocommerce product option select, the options does not have id nor class selector.

这是我在产品选项上看到的代码

Here is the code I saw on product options

<select id="product-type" name="product-type">
<optgroup label="Product Type"><option value="simple" selected="selected">Simple product</option>
<option value="grouped">Grouped product</option><option value="external">External/Affiliate product</option>
<option value="variable">Variable product</option></optgroup>
</select>

我的问题。有没有一种方法可以在woocommerce或wp更新期间不影响该选项选择框上隐藏分组产品和附属产品类型?

My question. Is there a way to hide grouped product and affiliate product type on that option select box in a way that it wont be affected during woocommerce or wp update?

谢谢

推荐答案

您可以使用命名选择器:

You can use named selectors:

#product-type option[value="grouped"] {
    ... your css here ...
}

请参阅此帖子: CSS来选择另一个基于HTML Select Option值的元素

这篇关于在woocommerce产品类型中隐藏选项选择项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆