• Resolved hsipani

    (@hsipani)


    I want that if any of the product is out of stock then the proceed to checkout button should be disabled in cart page. How to achieve that?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support Stuart Duff – a11n

    (@stuartduff)

    Automattic Happiness Engineer

    Hi @hsipani,

    By default, if a product is out of stock on a WooCommerce installation it could not be added to the cart. For out of stock products there would be no Add To Cart button which would display on the product listing page, this prevents customers from being able to add out of stock products to the cart.

    Thread Starter hsipani

    (@hsipani)

    I am not talking about product page. Suppose I added a product to cart but didnt buy. After some time when I come back I find that product is out of stock. At the time I want that when the error is getting displayed in cart the proceed to checkout button gets disabled

    Plugin Support AW a11n

    (@slash1andy)

    Automattic Happiness Engineer

    Hey again!

    If they come back and the item is no longer in stock, WooCommerce by default will remove the item from their cart. They then can proceed to checkout (if they have other, in stock items in their cart).

    If this is something you’d like to change (so that the out of stock items are not removed, just prohibited from buying), then you’d want to customize WooCommerce a bit to make that happen.

    We highly recommend contacting one of the services on our Customizations page (https://woocommerce.com/customizations/)

    Thread Starter hsipani

    (@hsipani)

    Woocommerce doesn’t remove the product by default in my website. Why?

    Plugin Support Stuart Duff – a11n

    (@stuartduff)

    Automattic Happiness Engineer

    Hi @hsipani,

    When a product that has previously been added to a customers cart is now out of stock if the customers visit the cart page they will see this message below displaying on the page. The customer cannot then purchase the product that is in the cart.

    Image Link: https://cloudup.com/cAhl9i-6c9w

    Below is an example of what would happen if they did try to proceed to checkout.

    Image Link: https://cloudup.com/cV5my0B3KJ3

    I’ve performed some cross-testing for us today on several of my sites which have the latest versions of WordPress, WooCommerce and our free Storefront theme as the only enabled software. When doing so I received the same results on all sites I tested with.

    Below is a screenshot of how I tested.

    Image Link: https://cloudup.com/chQ0lsT9ljS

    If this is not working for you the reason wouldn’t be directly related to the WooCommerce plugin itself. It could be a conflict from a plugin or theme installed and activated on your WordPress installation.

    I hope this helps.

    Thread Starter hsipani

    (@hsipani)

    I know it shows the error message in cart but the checkout button is still clickable. It will take the user to checkout where it will tell user to go back to cart. What I want is that the button becomes disabled if any product is out for stock which will prevent the user to even go to checkout page

    Plugin Support Stuart Duff – a11n

    (@stuartduff)

    Automattic Happiness Engineer

    Hey @hsipan,

    It may be possible to have a developer write some custom code that could achieve this though. If you would like to investigate that possibility further, you could reach out to some of the official WooCommerce development partners via this link below.

    https://woocommerce.com/customizations/

    You could also try using this code snippet below which I found in a Google search for you.

    https://stackoverflow.com/a/64235526

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Disable Proceed to Checkout in Cart Page’ is closed to new replies.