Inquiry button functionality

denisk's picture
denisk
Mon, 08/08/2016 - 07:25
#1
Inquiry button functionality

Dear Khoa,

I would really appreciate if you could help me with this one.

I need to create new button on every Unit description content type page (see the picture below).

http://i.imgsafe.org/86b5ada62d.png

When it's pressed, it should open up webform very similar to the one used to create comments in guestbook (see the picture below).

http://i.imgsafe.org/86b5ca6c57.png

Same css with the addition of two new fields of "Arrival date" and "Departure date" as well as the field "Apartment title" that would keep apartment title. When button "Send inquiry" is pressed, email with all the data from the text boxes as well as "Apartment title" should be sent to admin email address.

Please, help me to achieve this. I will send the copy of this message to your email as well as links to my drupal files and dayabase.

Thank you in advance. Hope to hear from you soon.

phuonght's picture
phuonght
Tue, 08/09/2016 - 00:08

Hi Denik,

We check your request and can see it is out of support policy. However, our developer can provide some simple instructions to help you work by yourself or if you would like him to customize you site, extra fee will be charged. 

cindy's picture
cindy
Tue, 08/09/2016 - 03:23

Hi,

Please check your email for more information

denisk's picture
denisk
Tue, 08/09/2016 - 07:10

Thank you very much for your reply. However, I don't think I won't be able to afford your extra customization at this price, because it's beyond my budget at the moment. So, I was wondering if the developer could give me short and simple instructions on this so I could try to figure it out by myself. Please.

phuonght's picture
phuonght
Wed, 08/10/2016 - 00:53

So here is instruction for you:

1. Create a new webform which has all required fields

2. Configure webform to display as block, configure email ....

3. Open file node--unit-description.tpl.php, after code 

<?php
module_load_include('inc', 'rooms_booking_manager', 'rooms_booking_manager.availability_search');
$form = drupal_get_form('rooms_booking_availability_search_form_block');
print render($form);
?>

add

<a href="#id_of_webform" class="awe-btn awe-btn-13 awe-ajax">WRITE IN GUEST BOOK</a>

4. Print webform in file, set id to #id_of_webform and fuction display: none.

denisk's picture
denisk
Wed, 08/10/2016 - 06:23

Thank you so much for your help, I followed your insrtuctions and I'm very close to solve the problem, so please, I'm only asking you for another few minutes of your time.

#1 and #2 steps I have done like this (see the picture below)

http://i.imgsafe.org/afcfd723d4.png

Also, I did #3 but I'm not sure if I have done it right way because form doesn't pop up. I'm not sure if I wrote the id_of_webform right, I found it from source code of the created webform (see the picture below)

http://i.imgsafe.org/afcfde0a26.png

And step #4 I found hard to understand so PLEASE, could you explain it in few sentences. Thank you so much for all your help so far.

D.

phuonght's picture
phuonght
Thu, 08/11/2016 - 05:50

So, please

1. Go to admin/structure/pages/nojs/operation/page-guest_book/handlers/page_guest_book__panel_context_9c4a17f8-365e-4774-a0cb-54256bc4e816/content. It is Guest Book with popup form.

2. Find 2 panels named "Custom: Guest Book Intro" and "Webform: Testimonial Form"

  •  "Custom: Guest Book Intro" is a panel displaying content that has button "WRITE IN GUEST BOOK". When clicking that button, you can see popup form.

  • "Webform: Testimonial Form" is panel containing popup form.

3. About code JS for event clicking button "WRITE IN GUEST BOOK", please open file scripts.js (sites\all\themes\md_hillter\js\front), find function "AwePopup". Our developer wrote it for event clicking button "WRITE IN GUEST BOOK" to display form. You can take a look for example. 

4. About step #4 

Please go to link https://www.drupal.org/node/26502, there is instruction to print webform. Because your Webform is assigned as block so we need to print in file node.

denisk's picture
denisk
Thu, 08/11/2016 - 09:32

Thank you once again for your explanation! I have just one more question here:

How to set href value, so this button would open guest-book-popup form on any custom page or block that I've made?

<a href="#WHAT-TO-PUT-HERE" class="awe-btn awe-btn-13 awe-ajax">WRITE IN GUEST BOOK</a>

Just to remind you that this button works on page /guest-book, and the code for the button is following

<a href="" class="awe-btn awe-btn-13 awe-ajax">WRITE IN GUEST BOOK</a>

And on the page /guest-book-2 the code for the button is exactly like this

<a href="ajax/ajax-guest-book-form.html" class="awe-btn awe-btn-13 awe-ajax">WRITE IN GUEST BOOK</a>
phuonght's picture
phuonght
Thu, 08/11/2016 - 23:04

We recommend to use code

<a href="" class="awe-btn awe-btn-13 awe-ajax">WRITE IN GUEST BOOK</a>

also, please take a look at step 3 at my above comment. 

Log in or register to post comments
Have More Idea?

We are here to build your website!

No Universal solution fits all special business requirements. Our experienced team is ready with ideas and state-of-the-art technical solutions to consult the best solution within your budget.