Hi, I used a function with filter ‘bricks/element/settings’
Before v.1.9.3 (1.9.2) this working:
add_filter( ‘bricks/element/settings’, ‘bricks_product_gallery_in_carousel’, 10, 2 );
function bricks_product_gallery_in_carousel( $settings, $element ) {
// if this is not the correct element or if WooCommerce is not active or if this is not a singular product page, return the default settings array
if ( $element->id !== ‘qczeyr’ || ! class_exists( ‘woocommerce’ ) || ! is_singular( ‘product’ ) ) {
return $settings;
}
// ensure the global $product variable is in scope
global $product;
// if $product is not an object, return the default settings array
if ( $product === false ) {
return $settings;
}
// get the product gallery attachment IDs
$product_gallery_images_ids = $product->get_gallery_image_ids();
// declare an empty array to store the new images settings
$id_product = (int) $product->get_image_id();
$new_images_settings = [
[
‘id’ => $id_product,
‘url’ => wp_get_attachment_image_url( $id_product, ‘thumbnail’ ),
‘full’ => wp_get_attachment_image_src( $id_product, ‘full’ )[0],
]
];
// loop through the product gallery image IDs and construct the new image settings array
foreach( $product_gallery_images_ids as $id ) {
$new_images_settings = array(
‘id’ => $id,
‘url’ => wp_get_attachment_image_url( $id, ‘thumbnail’ ),
‘full’ => wp_get_attachment_image_src( $id, ‘full’ )[0],
);
}
// replace the element’s images settings array with the above array
if ( ! empty( $new_images_settings ) ) {
$settings[‘items’][‘images’] = $new_images_settings;
$settings[‘items’][‘size’] = ‘full’;
}
return $settings;
}
With last version is always empty. It’s a bug?