Notices output outside of notices wrapper
-
The cart page on one of my client’s sites is laid out using CSS grid. We noticed that when notices from this plugin were being output on the cart page, they were breaking the layout and appearing stacked on top of one another.
I found that this is because the notices are not being output into the correct container. In
v1/loader.phpin theFlycartWooDiscountRules::displayAppliedDiscountMessagesForCartRules()andFlycartWooDiscountRules::displayAppliedDiscountMessagesForPriceRules()functions , the notices are being output directly withwc_print_notice. Since these are hooked towoocommerce_before_cart, they output above the cart, but they do not output inside of the.woocommerce-notices-wrapperas they should.Changing these functions to use
wc_add_noticeinstead will make sure they output in the correct wrapper. I’ve tested this on a client’s site and just making this change fixes the issue and doesn’t appear to cause any other problems. Please consider fixing this in the next release of your plugin.
The topic ‘Notices output outside of notices wrapper’ is closed to new replies.