Add conditions of purchase on woocommerce

[ad_1]

Hi everyone, on an e-commerce site I need all products to be sold only if you have the membership card. So not having found any useful plugins for this; on the woocommerce shopping cart page, I put a checkbox with two options “I have the card and I don’t have the card”, the answer is mandatory. If it says you have the card the user can go to the checkout page to complete the order, if not I would like to have the card added to the cart and (card ID 3610) and then the checkout page opened. If you have alternatives that’s fine, the only thing that matters is to have a solution that works because I’ve spent whole days and can’t come up with it! I trust in your precious help.

[ad_2]
1 Comment
  1. Add to cart buttons for all products should have the add to cart button replaced with membership card required, and a button to purchase the card.

    Require login for purchases.

    Then use woocommerce_after_shop_loop_item hook to make the magic happen.

    You’ll want to check if the membership card has been purchased and if true, return, if false do things

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer