I have a few Questions

1. Upgrade/Addon Products
I can only redirect to a other page or to Cart. There is no redirect to Upgrade/Addon Products. It seems to be missing?

2. Search Results Price Details.
How can i disable this.

3. Search Results Customizing.
How can i customize this? There is an hotel_booking_search_results.tpl.php, but changing this has no results (i'm not that good at Drupal!). I would really like to customize the results page, because we use the (very nice Module) for Holiday Homes.

Please help

Comments

larowlan’s picture

1) Under General settings -> browser redirect options you can choose other then enter the url in the field after that (you might need the dev version for this functionality)
2) Copy hotel_booking_search_results.tpl.php to your theme, flush your cache and edit that one - removing the appropriate sections
3) If editing the copy of hotel_booking_search_results.tpl.php in your theme (see point 2) doesn't provide enough flexibility, you can implement phptemplate_preprocess_hotel_booking_search_results in your theme's template.php (see the version template_preprocess_hotel_booking_search_results in hotel_booking.module to see where the results get set up).

paardje’s picture

2 and 3 i already found and got it working.

Under General Setting --> browser redirect there is an option to redirect to Upgrade/Addon Products. That is not working. So i can redirect to an other url, but i need to redirect to the room-specific Upgrade and Addons.

Is this option present in this version? if not, how do i redirect to the specific addon products for this roomtype (what is the url?).

larowlan’s picture

Hi
The second option 'Upgrade/Addon form' is where it needs to go to.
Unfortunately Ubercart does not hand back the cart item id after we add an item to the cart so we're forced to use db_last_insert_id.

Here's the code that does it:

    $redirect_destination = variable_get('hotel_booking_redirect', 'cart');
    uc_cart_add_item($node->nid, 1, $data);
    drupal_set_message(t('Added your booking to the cart, please note that your booking is not
                         confirmed until you <a href="!url">Complete checkout</a>', array('!url' => url('cart/checkout'))));
    $cart_item_id = db_last_insert_id('{uc_cart_products}', 'cart_item_id');

    if ($redirect_destination == 'cart') {
      drupal_goto($redirect_destination);
    }
    elseif ($redirect_destination == 'addon') {
      drupal_goto('booking_upgrades/'. $cart_item_id);
    }
    else {
      drupal_goto(variable_get('hotel_booking_redirect_otherurl', ''));
    }

To be honest I didn't write the addons module and I'm not entirely comfortable with how it works. It is on my to-do list but as I've never used it - it's not high on my list.

paardje’s picture

Hi,

Thank you for helping me. It works!

Greetings from Austria.

paardje’s picture

Status: Active » Closed (fixed)