Ecommerce Shopify WordPress Discussion

WooCommerce prevent direct url access to checkout page, allow access only if user clicked "checkout" button in the cart page

I've customized my WooCommerce cart page with additional input fields for each product. Some of these extra inputs are required and must be filled before proceeding to checkout. Currently, users can bypass this by entering the checkout URL directly. I want to restrict access so users can ONLY reach the checkout page by clicking the 'checkout' button on the cart page. If someone tries to access the checkout URL directly, I'd like them redirected back to the cart page to fill the required inputs (also so they are able to see the optional inputs and fill some of them if they'd like). How can I implement this? Edit: I understand that I could check if the required inputs are filled and if so allow access to the "checkout" page otherwise redirect to the "cart" page. However, I prefer a solution where direct URL access to the checkout page is prevented entirely, and access is only granted if the user clicks the "checkout" button on the cart page. This is because some products may have all its extra inputs optional, and if the user accessed the checkout page directly, they might miss the opportunity to fill in those inputs (if they wanted to).
TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.