• Resolved elmersw

    (@elmersw)


    It seems the woocommerce_output_all_notices function should wrap all notices inside the ‘woocommerce-notices-wrapper’ class. But in the end it doesn’t. So it’s really hard to change the appearance of notices as they are not all inside the wrapper.

    I have made a (partial) overview:

    Shop page
    Type: error, Content: Insufficient Stock, Wrapper used: Yes

    Cart page
    Type: success message, Content: Cart updated, Wrapper used: Yes
    Type: error, Content: Coupon not valid, Wrapper used: Yes
    Type: ?, Content: Empty cart, Wrapper used: NO
    Type: success message, Content: Product removed from cart, Wrapper used: Yes
    Type: success message, Content: Coupon applied, Wrapper used: Yes

    Checkout page
    Type: info, Content: Have a coupon?, Wrapper used: NO
    Type: error, Content: Required fields missing, Wrapper used: NO
    Type: error, Content: Coupon not valid, Wrapper used: NO
    Type: success message, Content: Coupon applied, Wrapper used: NO

    On top of that, the structure is not consistent. Based on the code I analyzed I expect the structure to be (expressed as classes):
    woocommerce/woocommerce-notices-wrapper/woocommerce-error (or -info or -message)

    Sometimes the wrapper is just left out and sometimes the wrapper is replaced by another subclass (for example woocommerce-form-coupon-toggle or woocommerce-NoticeGroup woocommerce-NoticeGroup-checkout).

    I’m using WooCommerce 5.9.0 and OceanWP theme (child). I have tested the behaviour mentioned above with Twenty Twenty-One theme and no plugins activated (except for WC of course)

    There is probably a good reason for this mess, but could you please reconsider restoring the basic structure?

    This would make it much easier to apply style sheets (and JS) to the notices.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Woocommerce notices outside wrapper’ is closed to new replies.