PHP Function to format text in connection

Apply conditional strikethrough formatting to text in a ChronoForms connection list.

Overview

The issue was caused by incorrect syntax in the PHP function, specifically improper quotation marks around the variable.
Correct the PHP function syntax by removing unnecessary quotes around the variable and ensuring proper concatenation for the HTML output.

Answered
mo momentis 24 Feb, 2015
I am trying to add a strikethrough on text in a connection list if a field in the row is set to a specific value. I have the following fields:

cust_names - Customer Name
cust_registered - Yes/No, showing if the customer has already registered

In my CC connection, I wish to show the customer name with a strikethrough if they have already registered (cust_registered = Yes). In the PHP Functions for the connection, I have the following:

cust.cust_names: return ($row['cust']['cust_registered'] == "No") ? '$row['cust']['cust_names']' : '<strike><b>".$row['cust']['cust_names']."</b></strike>');


Which is not working. Any idea what I am doing wrong?

Thanks!!
Rick
Max_admin Max_admin 24 Feb, 2015
Answer
Hi Rick,

Please try this code:
cust.cust_names: return ($row['cust']['cust_registered'] == "No") ? $row['cust']['cust_names'] : '<strike><b>'.$row['cust']['cust_names'].'</b></strike>';


Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
mo momentis 24 Feb, 2015
That did it. Thanks, Max!!!!

Rick
This topic is locked and no more replies can be posted.