Add automatically a text in front of a field specific value

More
14 years 1 month ago #11363 by vlester
Hello,

In my template item.php, I display a flexicontent date field which has several values. I would like to add automatically a text in front of a specific value.
For example, if one of the value is a Wednesday, I would like to specify a special price for this day of the week.
With the code I wrote, it does display the specific price if a wednesday is found among the list of the values but the text is displayed at the very end of the list when I would like it to be displayed on the wednesday value line.
I don't know how to call for a specific value.
Any idea ?
Thanks for your support,
Best regards
Code:
if (isset($this->item->positions['screeningdates'])) : ?> <!-- BOF screeningdates block --> <div> <ul> <?php foreach ($this->item->positions['screeningdates'] as $field) : ?> <li> <?php echo $field->display; $findwednesday='Mercredi'; $wednesday = strpos($field->display, $findwednesday); if ($wednesday!==false) : ?> <sup class="exposant">Tarif unique : 4,50 €</sup> <?php endif; ?> </li> <?php endforeach; ?> </ul> </div> <!-- EOF screeningdates block --> <?php endif; ?>
Attachments:

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

More
14 years 1 month ago #11496 by effrit
hi,vlester
i am not sure, but i think what
"!==" must be rwplaced to "!="
or even
if (!($wednesday))

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.376 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline