• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: PHP E-Mail Scripts RSForm TicketsTotal

PHP E-Mail Scripts RSForm TicketsTotal 1 month 2 weeks ago #43296

  • kk57
  • kk57's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
First of all, please excuse my bad English!

Unfortunately, support couldn't help me, so I'm hoping that someone here can give me a tip on how to proceed,
or maybe I'm making a mistake in the procedure.

We use
Joomla Versin 5.03
RSEvent: RSEvents!Pro 1.14.6
RSForm! Pro 3.3.0
"RSEvents!Pro Cart" is not installed because, according to RSJoomla, it is not compatible with The RSEvents!Pro - RSForm!Pro and we need the RSForm!Pro.

Usually, we have two types of participation fees (= tickets), for example:
Seminar fee: € 80.00
KMC / KMG members: € 60.00

A participant must select at least one participation fee once, but he can also register several people at different prices.

If he registers alone, the participation fee (tickets) is always either € 60.00 or € 80.00;
If several people register, the participation fee (tickets) is always greater than € 80.00.

If the participation fee is greater than €80.00, then several places have been reserved.

A “hidden field” with the name Plaetze and the value plaetze has been stored in the form and a “query” should now be made under
PHP E-Mail Scripts if the participation fee (=value/sum of TicketsTotal) is equal € 60.00 or € 80.00,
'k1 Nach Erhalt dieser E-Mail ist für Sie verbindlich ein Platz reserviert '
should be outputted at "plaetze".

If the participation fee is NOT € 60.00 or € 80.00 then
'k2 Nach Erhalt dieser E-Mail sind für Sie verbindlich die Plätze reserviert'
should be outputted at "plaetze".

This is the “code” that was stored in PHP E-Mail Scripts:
if($_POST['form']['TicketsTotal'] == '80.00')
$userEmail['text']=str_replace('plaetze', 'k1 Nach Erhalt dieser E-Mail ist für Sie verbindlich ein Platz reserviert.' ,$userEmail['text']);
 
if($_POST['form']['TicketsTotal'] != '80.00')
$userEmail['text']=str_replace('plaetze', 'k2 Nach Erhalt dieser E-Mail sind für Sie verbindlich die Plätze reserviert.' ,$userEmail['text']);

This variants have been tried,
80
80 €
80.00
80.00 €
80,00
80,00 €

but it always outputs
''k2 Nach Erhalt dieser E-Mail sind für Sie verbindlich die Plätze reserviert.''

What am I doing wrong or where is the error?
Thank you in advance!
Last Edit: 1 month 2 weeks ago by kk57. Reason: correction: insert "php code"
The administrator has disabled public write access.

PHP E-Mail Scripts RSForm TicketsTotal 1 month 2 weeks ago #43310

  • kk57
  • kk57's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
kk57 wrote:
First of all, please excuse my bad English!

Unfortunately, support couldn't help me, so I'm hoping that someone here can give me a tip on how to proceed,
or maybe I'm making a mistake in the procedure.

We use
Joomla Versin 5.03
RSEvent: RSEvents!Pro 1.14.6
RSForm! Pro 3.3.0
"RSEvents!Pro Cart" is not installed because, according to RSJoomla, it is not compatible with The RSEvents!Pro - RSForm!Pro and we need the RSForm!Pro.

Usually, we have two types of participation fees (= tickets), for example:
Seminar fee: € 80.00
KMC / KMG members: € 60.00

A participant must select at least one participation fee once, but he can also register several people at different prices.

If he registers alone, the participation fee (tickets) is always either € 60.00 or € 80.00;
If several people register, the participation fee (tickets) is always greater than € 80.00.

If the participation fee is greater than €80.00, then several places have been reserved.

A “hidden field” with the name Plaetze and the value plaetze has been stored in the form and a “query” should now be made under
PHP E-Mail Scripts if the participation fee (=value/sum of TicketsTotal) is equal € 60.00 or € 80.00,
'k1 Nach Erhalt dieser E-Mail ist für Sie verbindlich ein Platz reserviert '
should be outputted at "plaetze".

If the participation fee is NOT € 60.00 or € 80.00 then
'k2 Nach Erhalt dieser E-Mail sind für Sie verbindlich die Plätze reserviert'
should be outputted at "plaetze".

This is the “code” that was stored in PHP E-Mail Scripts:
if($_POST['form']['TicketsTotal'] == '80.00')
$userEmail['text']=str_replace('plaetze', 'k1 Nach Erhalt dieser E-Mail ist für Sie verbindlich ein Platz reserviert.' ,$userEmail['text']);
 
if($_POST['form']['TicketsTotal'] != '80.00')
$userEmail['text']=str_replace('plaetze', 'k2 Nach Erhalt dieser E-Mail sind für Sie verbindlich die Plätze reserviert.' ,$userEmail['text']);

This variants have been tried,
80
80 €
80.00
80.00 €
80,00
80,00 €

but it always outputs
''k2 Nach Erhalt dieser E-Mail sind für Sie verbindlich die Plätze reserviert.''

What am I doing wrong or where is the error?
Thank you in advance!
The administrator has disabled public write access.

PHP E-Mail Scripts RSForm TicketsTotal 1 month 1 week ago #43329

  • kk57
  • kk57's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
Problem solved:

2 hidden fields:
tnplatz
plaetze

JavaScript
<script type="text/javascript"> function populate(){ document.getElementById("tnplatz").value=document.getElementById("grandtotal").innerHTML; } </script>
The result of the total number of “TicketsToal” (=grandtotal), which is published in the form is passed to tnplatz
then depending on the value
 if($_POST['form']['tnplatz'] == '60.00 €') 
$userEmail['text']=str_replace('plaetze', ' k1 Nach Erhalt dieser E-Mail ist für Sie verbindlich ein Platz reserviert.' ,$userEmail['text']); 
 
if($_POST['form']['tnplatz'] == '80.00 €') 
$userEmail['text']=str_replace('plaetze', 'k1 Nach Erhalt dieser E-Mail ist für Sie verbindlich ein Platz reserviert.' ,$userEmail['text']); 
 
if($_POST['form']['tnplatz'] != '80.00 €') 
$userEmail['text']=str_replace('plaetze', 'k2 Nach Erhalt dieser E-Mail sind für Sie verbindlich die Plätze reserviert.' ,$userEmail['text']); 

the stored text (k1 or k2) is output in “plaetze”.
The “trigger” for the javascript is added to
submit button under additional attributes
onclick="populate()"
It's probably not the best solution, but it works...

Best regards!

This thread can now be closed
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!