Divi - Custom Sidebar For WooCommerce Pages
<?php /* Don't include this line if your child theme functions.php already includes it */
function my_et_divi_output_content_wrapper_end() {
echo '</div> <!-- #left-area -->';
if (
( is_product() && 'et_full_width_page' !== get_post_meta( get_the_ID(), '_et_pb_page_layout', true ) )
||
( ( is_shop() || is_product_category() || is_product_tag() ) && 'et_full_width_page' !== et_get_option( 'divi_shop_page_sidebar', 'et_right_sidebar' ) )
) {
dynamic_sidebar( 'eCommerce Sidebar' );
}
echo '
</div> <!-- #content-area -->
</div> <!-- .container -->
</div> <!-- #main-content -->';
}
function my_et_woocommerce_custom_sidebar() {
remove_action( 'woocommerce_after_main_content', 'et_divi_output_content_wrapper_end', 10 );
add_action( 'woocommerce_after_main_content', 'my_et_divi_output_content_wrapper_end', 10 );
}
add_action( 'after_setup_theme', 'my_et_woocommerce_custom_sidebar', 50 );
/* Don't include this line if your child theme functions.php already includes it */ ?>