Closed nielslange closed 10 months ago
I took a quick look. As you can see in screenshot below, SVG icon is not loaded while using Storefront theme:
The reason for this is wp_kses_post()
of storefront_shop_messages
:
if ( ! function_exists( 'storefront_shop_messages' ) ) {
/**
* Storefront shop messages
*
* @since 1.4.4
* @uses storefront_do_shortcode
*/
function storefront_shop_messages() {
if ( ! is_checkout() ) {
echo wp_kses_post( storefront_do_shortcode( 'woocommerce_messages' ) );
}
}
}
This behavior has been there since 1.4.4 so there is a great chance that many sites rely on this behavior.
We're now between two options:
wont fix
.What do you think?
Thanks for looking into this, @dinhtungdu.
Add svg and its child elements to allowed html tag, see https://github.com/woocommerce/storefront/pull/2133
For consistency-reasons, I believe updating the filter to show the SVG is the better approach.
Describe the bug
In p1702031295900509-slack-C02UBB1EPEF, @jimjasson reported that one of their e2e was failing. It turned out that this test was failing because of https://github.com/woocommerce/woocommerce-blocks/pull/12043. While looking into this issue, I noticed that for some actions, the notice icon is missing when using the Storefront theme. I tested the same action against all core classic themes (Twenty Ten until Twenty Twenty-One) and against a few other classic themes. So far, I've only seen this issue when using Storefront.
Isolating the problem (mark completed items with an [x]):
To Reproduce
“{PRODUCT}” has been added to your cart.
does not show an icon. ❌Cart updated.
does not show an icon. ❌Coupon code applied successfully.
shows an icon. ✅Coupon code already applied!
shows an icon. ✅Coupon "{CODE}" does not exist!
shows an icon. ✅Coupon has been removed.
shows an icon. ✅Your cart is currently empty.
shows an icon. ✅“{PRODUCT}” removed. Undo?
does not show an icon. ❌Screenshots
Expected behavior
I expect to see the icons in all notices.
Browser Environment
WordPress Environment