Change design when cart page is empty

Hello,

how to change the design or anything when the cart page is empty in Cornerstone? Content element for cart display don’t have any options.

Best regards,

Ofir

Hello Ofir,

Thanks for writing to us.

You need to go to the element —>customize —>Conditions —>set the conditions type as Number and insert the condition if the cart item is not equal to zero. It means the element will be shown only when you have cart items more than 0.

{{ woocommerce.cart_items_raw }} != 0

In case you have not seen the conditions and assignment doc please have a look at it.

Hope it helps
Thanks

Hello,

this will work but when I empty cart, another condition to show my elements don’t kick in, only after refresh. Is it possible to do something about that?

Best regards,

Ofir

Hey Ofir,

Regretfully at this moment we do not have a function, feature or another condition that gets trigger when emptying the cart. The cart page at of this moment needs to be refresh. You may need a custom JS code that will detect the cart and immediately refresh the page when it is empty.

Best Regards.

Hello,

another question. As Woo is now on block style, I tried to create empty cart component and call it with shortcode on cart page. But when I do that, there is an error:

Unexpected error in: woocommerce/empty-cart-block

Minified React error #60; visit https://reactjs.org/docs/error-decoder.html?invariant=60 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.

Any advice on this? Is this even possible?

Best regards,

Ofir

Hi Ofir,

It will be very difficult to understand the issue you are having, without investigating it through the WordPress admin dashboard. I would suggest you please provide login credentials for your site in a secure note to examine it further, including:

– WordPress Site URL & Login URL
– WordPress Admin username/password
– Specific layout where you have added this component.

To create a secure note, click the key icon underneath any of your posts.

Thanks

Hello,

data is in secure note.

Hey Ofir,

I could not find the shortcode in your component:

Please clarify. Thanks.

Hello,

I exported that component with a shortcode and put it in the block editor of the cart page when you change the view to an empty basket.

Best regards,

Ofir

Hello Ofir,

Where did you edited and inserted the Component shortcode? I am confused because I cannot find it.

  • See the secure note.

Thanks.

Hello,

when you edit the page in the block editor, click on the products element and there will be an option to change to an empty cart.

Best regards,

Ofir

Hello Ofir,

When I edit the page via the WP Editor, I could not replicate the screenshot.

  • See the link in the secure note below.

Could you please provide us a video screencast so we will have an idea of how it looks like on your browser?

Thanks.

Hello,

its added in secure note.

Best regards

Ofir

Hello,

Is there any news about this?

Hello @Ofir,

Regretfully the Component shortcode for the empty cart will not work with the WooCommerce block. You may need to use native WooCommerce cart blocks. If you want to customize the cart, this video might help you:

Hope this helps.

Hello,

thanks for checking. Does that mean the Component shortcode won’t work at all with the Block editor?

Best regards,

Ofir

Hello Ofir,

Yes, as our colleague @ruenel mentioned the Component shortcode will not work in the Block editor.

Hope it helps
Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.