Skip to content

Commit 5a3619d

Browse files
authored
Fix missing icons (#1588)
* Revert "Remove custom WooCommerce font usage (#1574)" This reverts commit c8e98b0. * Load CSS fonts from PHP side so path can be dynamic * Revert "Revert "Remove custom WooCommerce font usage (#1574)"" This reverts commit 29c7f29. * Fix wrong icons in messages and errors
1 parent fa92f79 commit 5a3619d

File tree

2 files changed

+40
-10
lines changed

2 files changed

+40
-10
lines changed

assets/css/woocommerce/woocommerce.scss

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1997,15 +1997,7 @@ p.no-comments {
19971997
.woocommerce-message {
19981998

19991999
&::before {
2000-
content: "\e015";
2001-
}
2002-
}
2003-
2004-
2005-
.woocommerce-error {
2006-
2007-
&::before {
2008-
content: "\e016";
2000+
content: "\f058";
20092001
}
20102002
}
20112003

inc/woocommerce/class-storefront-woocommerce.php

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ public function __construct() {
2626
add_action( 'after_setup_theme', array( $this, 'setup' ) );
2727
add_filter( 'body_class', array( $this, 'woocommerce_body_class' ) );
2828
add_action( 'wp_enqueue_scripts', array( $this, 'woocommerce_scripts' ), 20 );
29-
add_filter( 'woocommerce_enqueue_styles', '__return_empty_array' );
3029
add_filter( 'woocommerce_output_related_products_args', array( $this, 'related_products_args' ) );
3130
add_filter( 'woocommerce_product_thumbnails_columns', array( $this, 'thumbnail_columns' ) );
3231
add_filter( 'woocommerce_breadcrumb_defaults', array( $this, 'change_breadcrumb_delimiter' ) );
@@ -35,6 +34,10 @@ public function __construct() {
3534
add_action( 'storefront_woocommerce_setup', array( $this, 'setup_integrations' ) );
3635
add_action( 'wp_enqueue_scripts', array( $this, 'woocommerce_integrations_scripts' ), 99 );
3736
add_action( 'wp_enqueue_scripts', array( $this, 'add_customizer_css' ), 140 );
37+
38+
// Instead of loading Core CSS files, we only register the font families.
39+
add_filter( 'woocommerce_enqueue_styles', '__return_empty_array' );
40+
add_filter( 'wp_enqueue_scripts', array( $this, 'add_core_fonts' ), 130 );
3841
}
3942

4043
/**
@@ -89,6 +92,41 @@ public function add_customizer_css() {
8992
wp_add_inline_style( 'storefront-woocommerce-style', $this->get_woocommerce_extension_css() );
9093
}
9194

95+
/**
96+
* Add CSS in <head> to register WooCommerce Core fonts.
97+
*
98+
* @since 3.4.0
99+
* @return void
100+
*/
101+
public function add_core_fonts() {
102+
$fonts_url = plugins_url( '/woocommerce/assets/fonts/' );
103+
wp_add_inline_style(
104+
'storefront-woocommerce-style',
105+
'@font-face {
106+
font-family: star;
107+
src: url(' . $fonts_url . '/star.eot);
108+
src:
109+
url(' . $fonts_url . '/star.eot?#iefix) format("embedded-opentype"),
110+
url(' . $fonts_url . '/star.woff) format("woff"),
111+
url(' . $fonts_url . '/star.ttf) format("truetype"),
112+
url(' . $fonts_url . '/star.svg#star) format("svg");
113+
font-weight: 400;
114+
font-style: normal;
115+
}
116+
@font-face {
117+
font-family: WooCommerce;
118+
src: url(' . $fonts_url . '/WooCommerce.eot);
119+
src:
120+
url(' . $fonts_url . '/WooCommerce.eot?#iefix) format("embedded-opentype"),
121+
url(' . $fonts_url . '/WooCommerce.woff) format("woff"),
122+
url(' . $fonts_url . '/WooCommerce.ttf) format("truetype"),
123+
url(' . $fonts_url . '/WooCommerce.svg#WooCommerce) format("svg");
124+
font-weight: 400;
125+
font-style: normal;
126+
}'
127+
);
128+
}
129+
92130
/**
93131
* Assign styles to individual theme mod.
94132
*

0 commit comments

Comments
 (0)