Сustom shop notices in Pro Layout

Hello! I’ve added custom shop notice in fuctions.php using hook ‘woocommerce_before_shop_loop’ , but it is not displaying in Pro shop Layout. Is there a way to make it work?

Hi @bolvinov,

Thanks for reaching out!

Are you using the Layout Builder in creating your shop? If yes, you don’t need to add any customization in functions.php because you can already add it using the Layout Builder.

If no, would you mind sharing your credential so that we can check your setup? To do that, please give us the following information in a Secure Note.

  • WordPress Login URL
  • Admin level username and password

You can find the Secure Note button at the bottom of your posts.

Thank you.

Yes I am using Layout Builder.

I use the function in functions.php which shows the notice about how much left for free shipping:

This notice beign added to the shop page with this snippet:
add_action( ‘woocommerce_before_shop_loop’, ‘wc_add_notice_free_shipping’ );

Is it possible to show this notice on shop page built with Layout Builder?

Hi @bolvinov,

Thank you for clarifying. There is an element called “Shop Notices” you can add to your WooCommerce Layout. This will let you control the location in the Layout where the notices should be displayed.

Unfortunately Shop Notices do not display this notice… That was the main reason of my question.

But I’ve already added it with shortcode.

My apologies @bolvinov, I missed the hook you mentioned. The woocommerce_before_shop_loop doesn’t run when using the Layout builder since it would introduce other markup.

What you’re doing might actually be possible with builder elements instead of custom code. Have you experimented at all with Element Conditions? Here’s some info on how they work: https://theme.co/docs/conditions-and-assignments#using-expressions

You can retrieve the subtotal with this: {{dc:woocommerce:cart_subtotal_raw}}. So using a condition, you could output a text element anywhere in your layout that only shows if a certain amount has been reached.

Ok! Thank you a lot! I will test it

Hi @bolvinov,

Great and let us know how it goes! If you have any other concerns or clarifications regarding our theme features, feel free to open up a new thread.

Thank you.

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