VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: biltong on July 06, 2018, 17:00:47 PM

Title: Link in shopper field 'field title'
Post by: biltong on July 06, 2018, 17:00:47 PM
Hi, does anybody know how to do this?

I have a checkbox field on the checkout page (additional to the TOS one) and want some or all of the 'field title' text to link to an article loaded in a modal popup.

Thanks
Title: Re: Link in shopper field 'field title'
Post by: Jörgen on July 06, 2018, 21:52:30 PM
I have something similar in my sign up for a newsletter module. The text for the field (checkbox in my case) is simply a link like this:
<a href="/index.php?option=com_content&amp;view=article&amp;id=999&amp;Itemid=999" target="_blank">I accept the GDPR policy.</a>

This redirects to another page but there may be other better solutions.

Jorgen @ Kreativ Fotografi
Title: Re: Link in shopper field 'field title'
Post by: GJC Web Design on July 06, 2018, 23:48:43 PM
check how the TOS is done:  components\com_virtuemart\sublayouts\tos.php
Title: Re: Link in shopper field 'field title'
Post by: biltong on July 09, 2018, 17:28:01 PM
Quote from: GJC Web Design on July 06, 2018, 23:48:43 PM
check how the TOS is done:  components\com_virtuemart\sublayouts\tos.php

I did find that code but backed out, looked too complicated to work out how the form finds this code as I'm not fluent at a developer level. Was hoping for something simpler - thanks for the reply.
Title: Re: Link in shopper field 'field title'
Post by: biltong on July 09, 2018, 17:30:15 PM
Quote from: Jörgen on July 06, 2018, 21:52:30 PM
I have something similar in my sign up for a newsletter module. The text for the field (checkbox in my case) is simply a link like this:
<a href="/index.php?option=com_content&amp;view=article&amp;id=999&amp;Itemid=999" target="_blank">I accept the GDPR policy.</a>

This redirects to another page but there may be other better solutions.

Jorgen @ Kreativ Fotografi

Thanks for the reply. I would also normally do it that way but this doesn't work with checkbox fields on the VirtueMart Account Maintenance. There's some trickery going on that is above my technical level.
Title: Re: Link in shopper field 'field title'
Post by: Jörgen on July 09, 2018, 18:27:24 PM
Hello, You are right, I stole this example from Mavros Xristoforos who uses it in his checkboxes. Vm does seem to filter out an doesn´t recognize html in the field title. Sorry no ideas other than taing on the tos.php.

regards

Jörgen @ Kreativ Fotografi