To get the template-parts cart files, Flatsome is using this code. How could I implement the mclude on it?
function dndstudio_refresh_header_cart_partials( WP_Customize_Manager $wp_customize ) {
if ( ! isset( $wp_customize->selective_refresh ) ) {
return;
}
// Cart
$wp_customize->selective_refresh->add_partial( 'header-cart', array(
'selector' => '.cart-item',
'container_inclusive' => true,
'settings' => array('cart_icon','header_cart_style','cart_icon_style','custom_cart_icon','header_cart_total','header_cart_title','html_cart_header'),
'render_callback' => function() {
get_template_part('template-parts/header/partials/element','cart');
},
) );
// Cart
$wp_customize->selective_refresh->add_partial( 'header-cart', array(
'selector' => '.header-nav .cart-item',
'container_inclusive' => true,
'settings' => array('cart_icon','header_cart_style','cart_icon_style','custom_cart_icon','header_cart_total','header_cart_title','html_cart_header'),
'render_callback' => function() {
get_template_part('template-parts/header/partials/element','cart');
},
) );
$wp_customize->selective_refresh->add_partial( 'header-cart-mobile', array(
'selector' => '.mobile-nav .cart-item',
'container_inclusive' => true,
'settings' => array('cart_icon','header_cart_style','cart_icon_style','custom_cart_icon','header_cart_total','header_cart_title','html_cart_header'),
'render_callback' => function() {
get_template_part('template-parts/header/partials/element','cart-mobile');
},
) );
}
add_action( 'customize_register', 'dndstudio_refresh_header_cart_partials' );