Add a link to custom field title, or just to form.

  • Posts: 21
  • Thank you received: 0
12 years 9 months ago #46514

Very grateful for any help with this. I've trawled the forum for a while now and found some bits and pieces that seem related to my predicament, but find myself in great confusion about how to achieve my goal. So, I now come begging...

I added the Terms and Conditions step to my Checkout workflow but really want to have Terms accepted by users when they register, not every time they go through checkout. So...

I have added a custom field to the Registration Form, as a required checkbox. No problem there. But what I need is a link to show the Terms, just like the workflow one (which will be removed shortly). It doesn't have to be integrated into the Title or Label of the checkbox, although making it part of the Title would be the best option. I found reference to adding a line to the Language file override, but it wasn't detailed enough for me to make anything work (if that was the right way to go about it); I'm afraid I need basic instructions...

So, can I get some help with creating a pop-up link, next to/close to/as part of the checkbox I've added, that enables newly registering users to read the Terms & Conditions article? My custom field is called 'address_acceptterms' and the Title is 'I accept the Terms and Conditions'. If any other info or screen shots would be of use, just let me know.

All advice much appreciated.
Cheers,
Frank

Please Log in or Create an account to join the conversation.

  • Posts: 441
  • Thank you received: 24
12 years 9 months ago #46517

Best if you wait for Nicolas, but i think you must modify custom_fields.php in component/com_hikashop/views/user or maybe in registration.php adding <a href=.../a>in the part where your td title is...
Dont know if this helps but i just tried

Last edit: 12 years 9 months ago by condorazul.

Please Log in or Create an account to join the conversation.

  • Posts: 21
  • Thank you received: 0
12 years 9 months ago #46592

Ok, thanks for that; I'll have a look at those files and hopefully Nicolas will be able to help further.

Please Log in or Create an account to join the conversation.

  • Posts: 83103
  • Thank you received: 13418
  • MODERATOR
12 years 9 months ago #46595

You need to set a translation key in your custom field title, like that: MY_TITLE

Then, edit your translation override as explained there www.hikashop.com/en/download/languages.html#modify and add a line like that:

MY_TITLE="<a href=' mywebsite.com/myjoomlaarticlelink ' target='_blank'>I accept the Terms and Conditions</a>"

That won't open the T&C in a popup but in a new tab. Opening it in a popup is a bit more complex.

Please Log in or Create an account to join the conversation.

  • Posts: 21
  • Thank you received: 0
12 years 9 months ago #46648

Ok, thanks Nicolas, that makes sense :)
I'm still having a little trouble though. Having hopefully understood correctly, I've adjusted the field title, and added the line to the Language Override, but the front end is displaying the title I created rather than the override. I imagine I'm doing something wrong that's very basic; could you help educate this simpleton?

I've attached a screenshot of the Custom Field screen, and the line I've added to the Lang Override is as follows (note I've pinched the code from the 'checkout terms and conditions' pop up link that seems to work nicely; hoping it'll work just as well here too).





TITLE_TERMSLINK="Please accept the <a href="/test/index.php/component/content/article?id=44&tmpl=component" class="modal" rel="{handler: 'iframe', size: {x: 450, y: 480}}" target="_blank">terms and conditions</a> before proceeding."

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 21
  • Thank you received: 0
12 years 9 months ago #46709

Ok, I've just realised a part of my error. Using double quotes in the syntax is no good at all. D'oh! So, corrected as follows:

TITLE_TERMSLINK="Please accept the <a href='/test/index.php/component/content/article?id=44&tmpl=component' class='modal' rel='{handler: 'iframe', size: {x: 450, y: 480}}' target='_blank'>terms and conditions</a>.

The amended Title and link now appear nicely. So, thank you for that! :D
One more bit though, if you would be so kind... The popup.

When activated and on the same page, the Checkout Terms and Conditions popup link works really well, but the link in the registration form opens a new tab/window instead of the nice neat popup. I've replicated the href code so am not sure what's stopping it from working. Any ideas?

Many thanks for your continued assistance :)

Please Log in or Create an account to join the conversation.

  • Posts: 83103
  • Thank you received: 13418
  • MODERATOR
12 years 9 months ago #46715

I don't think that you can have such HTML.
As you need to use the simple quote as delimiter of attributes, since the double quotes are reserved by joomla, you can't use them in the rel attribute.
That's probably why it's not working properly for the popup, and why I said that it was more complex.
I think that the solution would be to use __QQ_ instead of the simple quotes of the attributes so that joomla replaces them with double quotes and that you can use the simple quotes in the rel attribute.

The following user(s) said Thank You: FranksBank

Please Log in or Create an account to join the conversation.

  • Posts: 21
  • Thank you received: 0
12 years 9 months ago #46756

Ok, sorted! Thank you very much for your help :)
I had no idea what the _QQ_ thing was so went off on a little expedition through Google. And now I have a working popup link! Hurrah!

All that's left now is to get rid of the word "Articles" that insists on appearing as an <H1> header when the popup opens (it happens with the Checkout T&Cs popup too, so doesn't seem linked to my fiddling). It's stumped me for the moment I must say; quite odd as it doesn't happen for the main article when accessed via the site menu.

Anyway, the main issue raised in this thread has been resolved, and once again I say THANK YOU VERY MUCH for all the help. I know you said the popup would be more difficult and you were right of course, but I wanted one and like a challenge :)

The code I have in place now, for the benefit of others perhaps, is:

TITLE_TERMSLINK="Please accept the <a href="_QQ_"/test/index.php/component/content/article?id=44&tmpl=component"_QQ_" class="_QQ_"modal"_QQ_" rel="_QQ_"{handler: 'iframe', size: {x: 450, y: 480}}"_QQ_" target="_QQ_"blank"_QQ_">terms and conditions</a>."

Cheers!
Frank

Please Log in or Create an account to join the conversation.

Time to create page: 0.085 seconds
Powered by Kunena Forum