saurabhd / hk_realestate

GNU General Public License v2.0
1 stars 0 forks source link

Add a button opening an inquiry popup form with the selected favorites in the inquired apartments field #6

Closed arpita-addweb closed 7 years ago

arpita-addweb commented 8 years ago

Site area : /favorites ,Priority : medium

Description : Same exists already for a single apartment on the apartment node - using ng_light box, display suite field and entity reference_re populate. If it is too involved to get favorites selected from the list (previous task), the whole list should be sent.

darshi-shah commented 8 years ago

Hi Rainer,

can you please explain about this ?

Thanks Darshi

heliogabal commented 8 years ago

Hi Darshi,

to open anything in ng_lightbox, you just have to add the class "ng-lightbox" to a link like so:

<a href="/anfrage?field_angefragte_wohnung=3762&destination=/node/3762&width=600&height=600" class="ng-lightbox btn">Anfrage stellen</a>

The .btn class just adds the basic styling. The path /anfrage is the CRM Core Profile form that should be opened in the lightbox, and the parameter field_angefragte_wohnung is the inquiry-for-field that is being prepopulated with the node ID of the apartment. This is defined in the CRM Core Activity type Anfrage field settings for the inquiry_for field.

But I guess you all figured that out already, so what exactly do you need me to explain? I think the pieces are all there, the only thing left to do is provide a way to send multiple nids to the URL parameter, so this would be for the favorites page:

<a href="/anfrage?field_angefragte_wohnung=3762,3763,376X&destination=/node/3762&width=600&height=600" class="ng-lightbox btn">Anfrage stellen</a>

To start with, all favorites on the page could be sent, so #6 can be solved independently from #5, if that's easier, and once #5 is solved, the parameter is filled by whatever mechanism you come up with selecting some of the favorites...

Hope that makes it more clear?

darshi-shah commented 8 years ago

Hi Rainer,

The code is pushed in develop branch. Please do following :

1 - take pull

2 - edit favorites view and change footer global text to have following : <div class="Inquiry-button btn " >Inquiry</a>

3 - Clear cache

Let me know any issues in this.

Thanks Darshi

heliogabal commented 8 years ago

ups, see my comment on #5 for this as well...

heliogabal commented 8 years ago

It's working now, but there are still some minor styling issues. The last row in the Inquiry for field would need to be hidden, and the custom styling for the Inquiry-button would have to be removed to comply with the rest of the button styles:

color: #C61C2C;
font-size: 20px;
font-weight: bold;

Also, I would prefer the <div class="Inquiry-button"> to be a link <a class="inquiry-button"> and lowercase to comply with the rest of the css, so in case someone has JS turned of or there is a JS error, the form could still get sent, but if that's too much work for now, we'll leave this bulletproofing for later.

darshi-shah commented 8 years ago

Hi Rainer,

Please do following to solve styling of button :

1 - take pull

2 - go to admin/structure/views/view/merkliste/edit/page

3 - set global:textarea in footer as following : <a class="inquiry-button btn ng-lightbox" href="/anfrage?field_angefragte_wohnung=&destination=/favorites&width=600&height=600" >Inquiry</a>

4 - save view

Please note that last row is still visible.

Thanks

darshi-shah commented 8 years ago

Hi Rainer,

Let me know once these steps are done so we can check on dev site.

Thanks

heliogabal commented 8 years ago

Hi Darshi,

it's absolutely weird... I did the steps as described on Friday, but it is like I'm working on another instance or something, because no matter what I do, the old footer is still shown.

favorites_footer favorites_footer_front

Maybe I'm too stressed to see the obvious here? Any idea what else than views caching (disabled) or drupal cache (cleared) it could be?

heliogabal commented 7 years ago

Hi Darshi, please ignore my comment on #5, I see this is finished and I will close it soon. I see now that the necessary HTML for the button changed, and I get the form just fine with one or several apartments selected for inquiry.

When I send an inquiry for two apartments in different object however, I'm getting two entries in the CRM, with the same apartments but faulty Object ID/Apartment No. (see screenshot). double_inquiry

Can you have a quick look and tell me if there is a quick way to either have one inquiry with two inquired apartments and the correct ID No., or two distinct inquiries with only one apartment per inquiry? Otherwise it's not too much to worry about, as it is still visible what is inquired and no data is missing. Thanks!

darshi-shah commented 7 years ago

Hi Rainer,

This is because of the relationship we are using in Unclaimed leads table. Removing this relationship will remove object-id and apartment no from "Inquiry for" column. Please let me know if thats okay.

Thanks

heliogabal commented 7 years ago

Well, as there will be apartments with the same title but different ID/No., it is important that this information is kept intact. Isn't there a simple way to change the query to distinct for example? Otherwise, you could probably change the multi-value values for the inquiry for field to create a new row instead of showing all in the same row. As there are several inquiries created anyway, that would be better. We would lose the correct image for the inquiry, but that doesn't matter. That's what it looks like for me if I configure it like that (the first two being sent with the favorites form): multiple_favorites

darshi-shah commented 7 years ago

Hi Rainer,

This is fixed and pushed on dev. Please revert hk_crm feature.

Thanks

heliogabal commented 7 years ago

Thanks! Closing this.