remove WooCommerce cart page

Hi

I want to remove cart page and add it to the checkout page , and found this code and add that to the function.php :

add_action( 'woocommerce_before_checkout_form', 'remove_cart_on_checkout_page_only', 5 );
 
function remove_cart_on_checkout_page_only() {
if ( is_wc_endpoint_url( 'order-received' ) ) return;
echo do_shortcode('[woocommerce_cart]');
}

after that need to remove cart page from woocomerce settings -Advanced - cart page

this is work on default wordpress theme but in bethem dos not work and when I chose the product the page will refresh and show me the with page with noting.

can you help me ?

Thanks

Comments

  • edited December 2020

    And one more thing , I installed only woo + using betheme

    the cart page is to heavy and gtmetrix show the error , is that related to theme?

    I mean this page tack to much time to load , more than 5second

  • Hi,

    Sorry, but we did not test this script and gtmetrix plugin with the theme. Our policy states that we do not support third party plugins or custom code so unfortunately, we cannot be of any help to you.

    Also, we cannot recommend any plugins other than the ones we support. You can find the list on this page, in the sidebar:

    [Links visible only for registered users]

    thanks

  • I didn't talk about plugins ! and gtmetrix have not plugin

    I have test the cart page in gtmetrix and show me the errors. Do you help me in this case?

  • Sorry, I tought you were talking about the gtmetrix plugin.

    Any WordPress theme can not be fully prepared according to tools like this one because their guidelines are ridiculous.

    Mainly plain html pages are suitable for these guidelines.

    Thanks

  • Okay fine.

    How to remove cart page ?

    Isn't that part of the support process ? because I got white page.

  • The only option is to set it in WooCommerce -> Settings -> Advanced and remove the Cart page from dropdown menu like you mentioned before.

    Also, you can remove it from Pages tab.

    Any further change must be done by modifying Theme files but we do not provide support with that.

    Thanks

  • Fine , Thank you?

Sign In or Register to comment.
This website uses cookies

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services.

Cookies are small text files that can be used by websites to make a user's experience more efficient.

The law states that we can store cookies on your device if they are strictly necessary for the operation of this site. For all other types of cookies we need your permission. This means that cookies which are categorized as necessary, are processed based on GDPR Art. 6 (1) (f). All other cookies, meaning those from the categories preferences and marketing, are processed based on GDPR Art. 6 (1) (a) GDPR.

This site uses different types of cookies. Some cookies are placed by third party services that appear on our pages.

You can at any time change or withdraw your consent from the Cookie Declaration on our website.

Learn more about who we are, how you can contact us and how we process personal data in our Privacy Policy.

Please state your consent ID and date when you contact us regarding your consent.