Hi,
To suit my project, I've written a custom module and submitted to uc_add_to_cart. However, I can't get the dates to be remembered. How do I do that? Please see http://people.sabanciuniv.edu/mtozses/time-info.png . There is also a demo at http://nemedya.ozses.net/node/13
Regards,
Comments
Comment #1
agill commenteduse uc_cart_add_item instead and use the third parameter, its an array that you can use for transporting
the dates and other data.
Would be a nice feature when your modul is ready.
Comment #2
kartagisHi again,
function book_date_check_form_alter(&$form, &$form_state, $form_id) {
unset($form['#submit']);
$form['#submit'][] = 'agres_bookings_buy_it_now_form_submit';
}
I did this, but I still can't get the date to show up :S
Comment #3
agill commentedHello Kartagis,
there is a Sessionvariable that holds this information at that time
and it gets read inside the agres_bookings_buy_it_now_form_submit.
$_SESSION['agreservationuserrequest'];
This is the session var that gets filled when using the search widget.
In your case it would make more sense, to use the form_state array
since you directly enter the dates on the same form that calls the
agres_bookings_buy_it_now_form_submit function.
i suggest using the same array name and same structure as
agreservationuserrequest array but inside the $form_state['values'].
then i would read that value if present in the agres_bookings_buy_it_now_form_submit function.
another question is, should it be allowed to have different timeranges(start and end date) inside the same
cart? that could cause problems and should at the beginning not be allowed, as i first have to
test/fix possibly occuring errors due to different dates in the cart.
Comment #4
agill commentedok i am almost ready providing this feature, along with some other goodies
like being able to block/free resources on the categories node view while watching an
availability calendar. it will be in one of the next commits