Woocommerce Cart Notices Reposition

Viewed 10

I have a popup window which I display size guides, contact forms, promotions, notices etc.

Is there a way to capture the notices on the cart page and append them to my popup with jQuery and then show the popup?

I believe on the cart page the only notices are to do with: Coupons and Product Removed/Updated.

Here is the notice enter image description here

1 Answers

You can hide the default notices via stylesheet. Every woocoommerce notice has a certain class appended to it, for example .woocommerce-info for the login or coupon notice.

In jQuery you can then query all container and get all texts inside that container.

For example:

var all = $(".woocommerce-info").map(function() {
 // Do something with each text
 console.log(this.text());
}).get();
Related