woothemes/woocommerce — Issue #504: Allow account creation only if specified products in cart
Author: midnightdonkey
Created: 2012-01-16 04:20:00+00:00
State: open

For me, I'm selling digital licenses, but I'm also selling smaller products - like setup packages, upgrades etc.. When an account is created, they automatically gain access to my Zendesk - which is linked with WordPress.

I don't want someone purchasing a lesser product with no license, and still gain access to support.

I've already altered the checkout.class.php file so I have this functioning.

After line 176: http://pastebin.com/xW7FUNT6

Checks if any of the specified product IDs are in the cart, if not - disable the account creation area.

Then - after line 503 (approx.. since my code above would have pushed it down a bit): http://pastebin.com/zem1ek9U

This basically disables the need for account creation if none of the products are in the cart - makes sure none of the validation errors come up when you order.

And that's it - the code lacks a message letting people know that an account can't be created because their cart doesn't meet the requirements or whatever.

Just throwing it out there - admin option would be easy, just separate product ID's by comma..

Works for me! =)

Tom