我使用此代码将数量插入到商店页面中。在产品页面上,它复制了我的盒子。我既不能用 css 也不能用 remove 函数删除它。你能帮助我吗?
附加照片...
function ace_shop_page_add_quantity_field() {
/** @var WC_Product $product */
$product = wc_get_product( get_the_ID() );
if ( ! $product->is_sold_individually() && '' != $product->get_type() && $product-
>is_purchasable() ) {
woocommerce_quantity_input( array( 'min_value' => 1, 'max_value' => $product-
>backorders_allowed() ? '' : $product->get_stock_quantity() ) );
}
}
add_action( 'woocommerce_before_single_variation', 'ace_shop_page_add_quantity_field', 12 );