I would like to sell hotel rooms which is a little more complex than selling books or CDs.
For example I sell a double room for $70 per night and a single room for $50.
I might then book 2 double rooms and 1 single room for 3 nights.
2 x $70 x 3 nights = $420
1 x $50 x 3 nights = $150
$420 + $150 = $570 in total
I'm trying to figure out how this mught be done in Tea Commerce because for each room product you've effectively got the two quantities to take into account, the number of rooms and the number of nights stay.
I had wondered if the best way to do it was to do all the calculations behind the scenes and add a single product to the basket with my calculated price.
That is a tricky one - but of course I have a solution :)
To support it you would create a product called "Double room" with a price of 70$. When the customer adds it to the cart you will take the quantity and multiply it with the nights to stay. In your example 2 x 3 = 6. You will then use the addOrderLine( nodeId, 6, async, successfn, errorfn, { "nightsToStay":3 } ). You will now have a total quiantity of 6 in your order. Then in your xslt you would just calc backwards to find the actual quantity of 2 and the output the nights to stay.
That solves the first thing. The other think you will have to look into is the addUniqueOrderLine. This give the customer the ability to add 2 x double rooms for 3 nights and 1 double room for 2 nights. Its not a common case but it could be a family where the boy would live the vacation ealier to play football :)
Dynamic product pricing?
I would like to sell hotel rooms which is a little more complex than selling books or CDs.
For example I sell a double room for $70 per night and a single room for $50.
I might then book 2 double rooms and 1 single room for 3 nights.
2 x $70 x 3 nights = $420
1 x $50 x 3 nights = $150
$420 + $150 = $570 in total
I'm trying to figure out how this mught be done in Tea Commerce because for each room product you've effectively got the two quantities to take into account, the number of rooms and the number of nights stay.
I had wondered if the best way to do it was to do all the calculations behind the scenes and add a single product to the basket with my calculated price.
Any tips?
Thanks,
Matt
Hi Matt
That is a tricky one - but of course I have a solution :)
To support it you would create a product called "Double room" with a price of 70$. When the customer adds it to the cart you will take the quantity and multiply it with the nights to stay. In your example 2 x 3 = 6. You will then use the addOrderLine( nodeId, 6, async, successfn, errorfn, { "nightsToStay":3 } ).
You will now have a total quiantity of 6 in your order. Then in your xslt you would just calc backwards to find the actual quantity of 2 and the output the nights to stay.
That solves the first thing. The other think you will have to look into is the addUniqueOrderLine. This give the customer the ability to add 2 x double rooms for 3 nights and 1 double room for 2 nights. Its not a common case but it could be a family where the boy would live the vacation ealier to play football :)
Hope it helps
/Anders
Thanks Anders,
I have a related question but it doesn't match the title of this post so I'll create another one in case it helps others.
is working on a reply...