1

Is there a way to test all possible notices that can appear in a WooCommerce store, so I can check they look OK?

As an alternative to stumbling around in the site trying to get messages to appear...

  • Product X has been added to your cart
  • Product X removed. Undo?
  • etc.
LoicTheAztec
  • 229,944
  • 23
  • 356
  • 399
Leeroy
  • 2,003
  • 1
  • 15
  • 21

1 Answers1

5

You can't list all WooCommerce notices (and it will not be useful as some 3rd party plugins add their own ones).

But there is 3 type of notices used on WooCommerce on Front end.

They all use a different template type located in woocommerce/templates/notices/ to be rendered. For each the html structure is as follow:

  • Success message type: <div class="woocommerce-message" role="alert">A success message…</div>
  • Notice message type: <div class="woocommerce-info">A notice message…</div>
  • Error message type: <div class="woocommerce-error" role="alert">An error message…</div>

Some of them can have additional html, like <strong>, <em>, <a>… with specific tag classes.

Some third party plugins can add their own additional html.

LoicTheAztec
  • 229,944
  • 23
  • 356
  • 399