I am using this below code to remove woocommerce sidebar, from cart and single-product page.
function urun_sidebar_kaldir() {
if ( is_product() || is_cart() ) {
remove_action( 'woocommerce_sidebar', 'woocommerce_get_sidebar', 10 );
}
}
add_action( 'woocommerce_before_main_content', 'urun_sidebar_kaldir' );
It works in single-product page, but it doesn't work cart page.
I can't remove sidebar in cart page.
//Update
I am not using woocommerce.php in theme main folder.
And i have this templates in my theme.
wp-content/themes/{current-theme}/woocommerce/cart/cart.php
I created custom teplate for cart. And i removed get_sidebar(); but sidebar is still displaying in cart page.
wp-content/themes/{current-theme}/page-cart.php
wp-content/themes/{current-theme}/page-checkout.php