Tags/topics: 
2
Answers
Vote up!
1
Vote down!

Handling a tour booking system pricing

Hi everyone,
I'm building an ecommerce that will sell tours.

Each tour will have a base price, and then a ticket price. There are various type of tickets (adult, children...) each with a different price.

So for example:
Bike tour: 60$
+2 adult tickets 30$
+1 child ticket 10$

total = 100$

I already have a sub-optimal solution with categories with attached price fields.
The problem is that an adult ticket for a tour may cost 15$, and cost 20$ for another for example.
So I'd need to create a lot of categories: adult tickets for tour a, adult tickets for tour b, children tickets for tour a, etc.
This would soon become unmanageable.

The other solution I thought about is this:
I created an adult ticket quantity field, and attached it to a line item, and then created an adult ticket price and attached it to the product type.
This would be great, but the problem is that now I'm not very sure on how to set the rules to calculate the price.

The client could have 3 different tours in a cart, and for each of them I'd need to calculate adult-ticket-quantity*adult-ticket-price and add it to the base price.

How can I solve this?
Thanks

Asked by: maiagallo
on January 29, 2013

2 Answers

Vote up!
0
Vote down!

I decided to solve this by implementing hook_commerce_cart_product_add and hook_commerce_cart_order_refresh.
It looks much easier to me this way

Answer by: maiagallo
Posted: Jan 29, 2013
Vote up!
0
Vote down!

Can you explain a bit what did u do to solve the problem? we are facing exactly the same issue

Posted: Aug 19, 2014