Bricks Version : 1.9.9
Browser : Opera
OS : Win.
URL : n/a
Uncaught Error: operator not supported for strings in \bricks\includes\woocommerce.php:2352
Reference: $attributes[‘class’] = ‘woocommerce’;
/**
* Add .woocommerce class to the main tag (#brx-content) when previewing woo templates in frontend OR if the current page is my account page
*
* Otherwise not all Woo CSS & JS is applied. In builder, we add this class inside TheDynamicArea.vue
*
* Woo Phase 3
*/
public function template_preview_main_classes( $attributes ) {
$post_id = get_the_ID();
$is_account_page = is_account_page();
if ( ! Helpers::is_bricks_template( $post_id ) && ! $is_account_page ) {
return $attributes;
}
$template_type = Templates::get_template_type( get_the_ID() );
if ( strpos( $template_type, 'wc_' ) === false && ! $is_account_page ) {
return $attributes;
}
// NOTE: Adds 20px padding to .woocommerce-cart .woocommerce (on tablet portrait), when previewing the template in frontend.
$attributes['class'][] = 'woocommerce';
return $attributes;
}
Temp fix
// Ensure $attributes['class'] is an array
if (!isset($attributes['class']) || !is_array($attributes['class'])) {
$attributes['class'] = isset($attributes['class']) ? [$attributes['class']] : [];
}