WAIT: Issues with Dynamic Styling for Empty Shopping Cart in Bricks Builder

Hello Bricks Community,

I’m working on a shopping cart system and have set up two templates using the Bricks Builder: one for when the shopping cart has items, and another for an empty cart. Everything functions well except for one specific issue.

When I have products in the cart and decide to remove them while in the cart, the empty cart template is triggered. However, not all styles are loaded at this point. For instance, the header image is missing, and the button appears unstyled.

If I refresh the page (F5), the styles load correctly. The issue only seems to occur when I remove the last item, and the empty cart appears. On first load, the styles are not applied, but after a refresh, everything looks fine.

I would appreciate any insights or advice on this matter. Specifically, I’m looking for a way to ensure the styles for the empty cart load dynamically and correctly when the last item is removed, without needing to refresh the page.

Thank you in advance for your help!

Rgds,
Artjom

Are the styles of the elements in those templates assigned to the ID or a class? I’ve had a fairly similar issue before (not invving woocommerce though), where my conditional template styles would only show correctly if all styles were done on a class level.

Might be worth a shot to copy over the ID styles to a class for each element, then re generate external css files and check again.

Hi Manc,
Thank you for your reply. No, I used only classes. A banner image is not loading correctly, and the button is unstyled. The button has a class that I used for all other buttons as well.
But it’s a good idea to try to style this button without any classes, maybe it will help.

Yes, it works. The button looks good now. It’s just the banner that is still not loading.

Hmm so it works the opposite way as it did for me.

Does the banner work with inline styles vs external files?

If the styles are fairly basic, you could try manually writing the css into your child themes style.css. That way they should always be present and you don’t have to rely on the template loading it’s styles (although of course it would be neat if that fully worked eventually)

I also found a solution for the banner. I have disabled “Lazy Load” for the banner.
So everything is working fine now.

Thanks for your help, it really helped.

Rgds,
Artjom

Hi Artjom,
Thanks so much for your report!

Can you do us a favor and create the problem as simple as possible in a test installation, recording a screencast so we have reproducible steps?

Feel free to send us the screencast link, access data, and a link to this thread to help@bricksbuilder.io. This is probably the fastest way to track down the problem.

Best regards,
timmse

Hello,
Still no positive feedback about this issue?

Hi Houcine,
Welcome to the forum!

As it stands, we didn’t get any of the information I asked for at the time. Accordingly, the issue came to nothing…

If the problem still exists for you, although the thread starter seems to have been able to solve it somehow: