Vote up!
Vote down!

How can I collect a one time fee?

I'm currently building a site that requires first time users to pay a fee if they are purchasing a product of a certain type for the first time.

Over view:

A school that sells classes/events online and requires an admin fee for first time students. Students pay this fee only the first time they register, and it can't be simply tied to account creation as some products on the site will be purchasable by non class taking users. In other words, if you are new and sign up for a class you pay $20 regardless of how many classes you purchase, if you are purchasing a school Tshirt, or tickets to a show, you do not. I think the right way to do this is through adding a role to the user once they have paid the fee, but I can't seem to figure out the exact logic.

What I've tried:

1. Create a rule on product added to cart that says if user doesnt have role admin fee paid and product type = class then add Admin Fee product.

-Doesn't work because the user can remove the product from the cart and it adds this product multiple times if the user buys multiple class products.

2. Create a pricing rule that if user doesn't have role then add admin fee.

-Also adds to each product that is of class type.

Ideally this would work like shipping where if its needed, its included as a line item and can't be optional, but I wasn't really sure how to structure that. Any help would be much appreciated!

Asked by: fullsaildan
on December 24, 2012

1 Answer

Vote up!
Vote down!


Once the admin fee is paid the user will be granted a new role. Only this role has the permission to order classes. This would be achieved via rules. In fact, you can use Drupal's built in roles to make it easier. Only authenticated users are allowed to complete the checkout process. Only users who have paid the admin fee can gain authenticated user permissions.

Answer by: drupalability
Posted: Jan 18, 2013