【问题标题】:Woocommerce Astra theme showing two add to cart buttonsWoocommerce Astra 主题显示两个添加到购物车按钮
【发布时间】:2022-01-10 07:11:08
【问题描述】:

我正在寻求帮助。我有 Astra 的(免费版)。它在每个产品上显示两个“添加到购物车”或“选择选项”按钮。如何删除其中之一?

添加此代码会删除两个按钮:

.single_add_to_cart_button, 
.add_to_cart_button { 
  display: none !important; 
}

.single-product .cart, .add_to_cart_button { 
  display: none !important; 
}

与此代码相同(顶部按钮上的代码,使用检查工具找到):

.button.add_to_cart_button.product_type_variable { 
  display: none !important; 
}

添加此代码不会删除任何按钮(底部按钮上的代码,使用检查工具找到):

.button.product_type_variable.add-to-cart_button { 
  display: none !important; 
}

非常感谢任何帮助!

【问题讨论】:

    标签: css wordpress woocommerce woocommerce-theming


    【解决方案1】:

    想通了。找不到重复的动作挂钩,但找到了一个对我有用的解决方法,即添加到这个 CSS 中:

    .button.add_to_cart_button.product_type_variable { 
      display: none !important; 
    }
    

    从类别页面中删除了两个按钮,但在产品页面上保留了添加到购物车按钮。

    根据我的阅读,这似乎是常见的 Astra 主题问题,所以也许他们会在某个时候修复。

    【讨论】:

      猜你喜欢
      • 2018-10-30
      • 1970-01-01
      • 1970-01-01
      • 2012-08-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-29
      • 2018-05-08
      相关资源
      最近更新 更多