Possible issue with Token processor and Smarty
When using smarty logic with custom fields they don't get considered as numeric values any more so no calculation operation can be processed. Sent as a 'normal' token, the token get merged. Nothing in the configuration changed. The custom are still declared as numeric. If combined with smarty, they become simple 'text' values and in our situation nothing happens, when it should be. This process was working since months until upgrading to 5.58.1 (on WP 6.1.1 and php 7.4) and was used many times to edit invoices:
{if $contact.custom_147==0}{else}- {contact.custom_147} Licences assurances annuelles = {$contact.custom_147*20}€{/if}
{if $contact.custom_154==0}{else}- {contact.custom_154} Licences assurances occasionnelles = {$contact.custom_154*15}€{/if}
{if $contact.custom_155==0}{else}- {contact.custom_155} Frais de gestion pour membre stagiaire en formation secourisme = {$contact.custom_155*10}€{/if}
{if $contact.custom_156==0}{else}- {contact.custom_156} Frais d'affiliation = {$contact.custom_156*150}€{/if}
Total réglé = {math equation="(op1*20)+(op2*15)+(op3*10)+(op4*150)" op1=$contact.custom_147 op2=$contact.custom_154 op3=$contact.custom_155 op4=$contact.custom_156}€
and this should show something like
- 2 Licences assurances annuelles = 40€
- 3 Frais de gestion pour membre stagiaire en formation secourisme = 30€
Total réglé = 70€