Hello, Mehmet,
Thank you for your response.
Additional customization in files is outside the scope of our basic support.
But we want to help you, please follow the next steps:
1/ Install patch #9146862 as indicated in the screenshot below: https://prnt.sc/kjuoEKbZh7OB
2/ Add the following code to wp-content/themes/xstore-child/functions.php:
add_filter('etheme_single_product_custom_tab_01_content_filter','etheme_block_by_brand');
function etheme_block_by_brand($content){
if ($content=='{{et_block_by_brand}}'){
$terms = wp_get_post_terms( get_the_ID(), 'brand' );
if ( ! is_wp_error( $terms ) && count( $terms ) > 0 ) {
if (isset($terms[0]->term_id)){
$args = array(
'post_type' => 'staticblocks',
'meta_query' => array(
array(
'key' => 'et_brand_id',
'value' => $terms[0]->term_id,
'compare' => '=',
)
)
);
$posts = get_posts( $args );
if (isset($posts[0]->ID)){
return etheme_static_block( $posts[0]->ID, false );
}
}
}
}
return $content;
}
3/ Go to Customizer -> WooCommerce (Shop) -> Tabs -> Custom Tab 01 Content and enter the code {{et_block_by_brand}} as indicated in the screenshot: https://prnt.sc/m0i2JFHd-8lY and save the changes.
4/ Go to the static block editing and scroll down to the “Custom Fields” section.
5/ Add a new custom field as indicated in the screenshot: https://gyazo.com/04ae5a72ac252664e99c34d846439a72 The “Name” field should always be et_brand_id and in the “Value” field, enter the brand ID. To find the brand ID, go to the brand editing window, details are in the screenshot: https://prnt.sc/SVx9wdkUGMQN
Kind Regards,
8theme team