SOLVED: Add to cart with variable product : "Clear" link is missing

Bricks Version: 1.5.3
Browser: Brave 1.43 / Chromium 105
OS: macOS
URL: https://729d-ad29f867efa0.wptiger.fr/produit/hors-du-temps/

Hi !

I’m currently migrating my website from elementor to bricks builder.

I use some of the woocommerce blocks including the “add to cart” block, with variable products.

I noticed that the “Clear” option that usually appears below the last variation is not present here.
So i cannot reset the selection which is a bit annoying…

Is it due to the behavior of the bricks block itslef or is it a bug ?

Greetings,

Quentin

Hi Quentin,
Welcome to the forum, and thanks for reaching out!

Right, so far, we don’t have a “clear” option because we don’t think it adds any value. If you want to make a different selection, you choose a different option anyway, so resetting is actually superfluous.

Or are we missing something?

Best regards,
timmse

Hi Stefan,
I’ve requested from a client for the “Clear” button. When you have 5, 6, or more variants it’s come in very handy… :wink:

I think there is a case where ‘clear option’ is nice to have. Especially when you have a variable product with more than 30 existing combinations.

When your variable product has more than 30 variations, WooCommerce will start using ajax to load your selected variation. This changes the way the dropdown fields work - whereas before you could select some options and others would become unavailable/disabled, now you have to select all the options before you realize the variation you selected is not available.

In my case, my products have 3 attributes:

  • print material (4 options)
  • size and
  • framing

For each print material, there are different size and frame options.

If you choose material A, you can choose a certain size and some framing options.
If you choose material B, the size and framing options available will not necessarily be the same.

I have up to 62 possible variations depending on the product so it will trigger the ajax loading.

Let’s change “woocommerce_ajax_variation_threshold” to the right value (> 62).

Now you will see all the options in the first dropdown.
But on all other lists, you will only see the available options (depending on your first choice).

So in some cases, depending on your attributes combinations, you will have to reset all lists by clicking on “Choose Option”, and then make your new combination.

With a “clear option”, you can reset all the lists at once in an easier to understand way.

Greetings,

Quentin

2 Likes

Hey guys,
Thanks so much for your responses!

Ok, persuaded: we add the clear option in one of the following versions :sunglasses:

Best regards,
timmse

3 Likes

Awesome !

I am looking forward to it :slight_smile:

Hey @QuentinW ,
Bricks 1.6 beta contains a clear option. However, we would be happy if you could briefly test whether the problem is fixed so that we can include it in Bricks 1.6 stable.

You can find the beta version in your account:
https://bricksbuilder.io/account/?v=1.6-beta

Best regards,
timmse

So far, so good… :+1:

image

1 Like

Hi !

Sorry to revive this post but i’m facing a (small) issue with the clear selection link.

Is there any way to move outside of the <table> so the items layout is not modified when the “clear selection” link appears.

Currently, it’s inside the last <tr>, so the layout changes when it pops.

Here’s the code and the suggested before / after


Hi Quentin,
The clear link is by default inside the table. Unfortunately, since we use the Woo default templates for compatibility and maintenance reasons, we can’t change this.

However, you could try to position the link differently (e.g. absolutely) with custom CSS:

form.cart table.variations .reset_variations {...}