NO BUG: WooCommerce "Limit purchases to 1 item per order" not hiding quantity

Browser: Chrome 110
OS: macOS
Video: CleanShot 2024-05-21 at 21.08.49 · CleanShot Cloud

Repeat issue:

Add some CSS styling to the Quantity field including a solid border with a width.
In WooCommerce set the product to “Limit purchases to 1 item per order”
View the single product page on the front end
Take note that although the DIV has no height, the border on a 0 height DIV is still video hence creating a line.

Bricks seems to not remove the Qty DIV correctly.

Suggestion:

Bricks to add display:none to the

element.

Suggestion: Completely removing Quantity per condition, for example, would be even better.
Because for example, if someone using Display Flex with a gap, the empty div is taken into account, which leads to an inconsistent gap

I’m sorry, can you spell it out to me please as I’m not understanding your suggestion? Apologies for my ignorance.

That was just my suggestion for implementation to the Bricks team :wink:

Haha. I understand. Sorry for my confusion. :smiling_face:

Hi Stewart,
Thanks so much for your report!

Unfortunately, I cannot reproduce the issue. The element is still in the DOM, but I can’t manage to make the border visible. Can you provide a live link?

Best regards,
timmse

DM’d you with details.

Thanks for the link!
Now I can understand why I can’t replicate the problem: the border is applied to a different selector in your case (frames custom CSS) than if you use the same settings in the builder :wink:

In principle, however, I agree with you and have created an improvement task.

1 Like

After reviewing this report, we decided to not address this natively in Bricks as hiding or removing the entire .quantity div can lead to other unexpected issues. Such as accidentally hiding HTML that has been added via the Woo native actions woocommerce_before_quantity_input_field and woocommerce_after_quantity_input_field which are located inside the .quantity div.

@StewartR If you really need to hide the entire quantity HTML on the single product page because of the Frames border you can try using the following custom CSS:

.brxe-product-add-to-cart .quantity:has(input.qty[type="hidden"]) {
	display: none;
}