hello,
when creating a room type content i can assign
some products' attributes but when i'm trying to book
that room i can't view the attributes choosen.
example :
attribute "person" with a list selection :
"normal person : 0€ from that price" and "company : -10€ from that price"
this for each room content.
when modifying the room node, i see the attributes but not when seeing that node
for booking it.
what i'm trying to do :
- 2 room types (single and double rooms),
- normal person/company person (10€ discount, actually trying with attributes),
- 1,2 and 3 persons per room (pricing with the rates modifier : ok).
is there something i missed please ?
Comments
Comment #1
aem34 commentedsorry i forgot :
i tried to do a modifier for this in the module,
but the modifiers aren't allowing for negative money values.
Comment #2
larowlanHi
Unfortunately the module doesn't work with Ubercart attributes.
That said though, you can achieve what you need using hook_form_alter if you're comfortable writing a module.
If you're not I can point you in the right direction.
What you're trying to achieve is not dissimilar to what was being attempted here (http://drupal.org/node/1071866#comment-4156546) - you just need to add a new field to the search box for type of person, then you need to modify the search results (the prices are value fields in the search results form).
If you're completely new to module building, there's a module called module_builder that will help you scaffold a module, but seeing as though you really only need one function, you can probably start by just making the info file and module files manually.
Lee
Comment #3
aem34 commentedComment #4
ludp commentedIs comment #2 (Ubercart attributes not supporte) still true for version 7.x-1.0-alpha1?
Comment #5
larowlanThe 7.x version is more sympathetic to other modules at the time of adding items to the cart, in so far as that it calls module_invoke_all('uc_add_to_cart_data', $form_state) which is where the uc_attributes modules ordinarily adds it's data to the cart item.
What it doesn't do is add the attributes form to the search results/book now form (the form on the room node) - however you can do this with an implementation of hook_form_alter that mimics how uc_attributes adds it's form elements to the standard ubercart add to cart form.
Comment #6
sylvainblot commented@larowlan I'm on my way to implement attribute support for d7.
what do you recommend? a submodule or modify hotel_booking ?
attributes affect the price so the function that handle the price calculation can be changed to :
hotel_booking_calculate_prices(
$check_in,
$check_out,
$rooms,
$adults,
$children,
$smoking,
$attributes,
$values
);
Is there an ubercart function to get the sum of all attributes ?
Comment #7
sylvainblot commentedHere is a submodule written by @larowlan, I've made some minor changes. It works on D7.
This not real room attributes but a page that is used as redirect after a booking that list products such as breakfast, wifi ect.
Default quantity is set to the last booking stay duration.
Please review ! Thanks
Comment #8
phuongnam3k commentedThanks sylvainblot,
But how to configure it, sorry I'm a newbie. I have installed it but cannot find how to set up the "room attributes" like you said.
How it works?
Thanks,
Comment #9
sylvainblot commented@phuongnam3k
In admin/store/hotel_booking/hotel_settings change your redirect URL to hotel-booking/accessories
Create a new ubercart product and it should appear on the list displayed after a room is added in the cart
Comment #10
sygnetica commentedHi.
I have problem with module Room Accessories:
Ubercart 7.x-3.0-rc3
Hotel Booking 7.x-1.0-beta1
Any idea ? Thanks
EDIT: Solution