简体   繁体   中英

How do I display all WooCommerce notices so I can theme them

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM