9 years ago
3
Topic

Hello!
I need to upgrade an existing Joomla web site with Seblod 1 to the new Joomla 3 and, of course, I need to upgrade and Seblod too. In the old site there is a registration form with many fields, but one of them is "free code", which is not present in the new Seblod. So, yesterday I bought "CODE PACK" as I need to execute a script with an event "Before Store" (the old version - OnBeforeContentSave). This script is transferring values to the email text placeholders #bec_fee_amount#, #bec_unique_id# and #bec_stautus_alias#. Everything is working OK on the old site. But when I try to execute the script on the new one - there is nothing. Here is my script which I try to execute "Before Store":


if($ARRAY['bec_unique_id']->value == "1000") {
$ARRAY['bec_unique_id']->value = strtoupper(uniqid());
$ARRAY['bec_stautus_alias']->value = "SUBMITTED";
$ARRAY['bec_aux_email']->value = $ARRAY['bec_email']->value;
$bec_fees = (strtotime(date("d-m-Y")) <= strtotime('31-01-2016'))? array(80,50,40,30,50,40): array(100,70,60,30,70,50);
switch($ARRAY['bec_regtype']->value) {
case "specialist":
$ARRAY['bec_fee_amount']->value = $bec_fees[0];
break;
case "pgstudent":
$ARRAY['bec_fee_amount']->value = $bec_fees[1];
break;
case "student":
$ARRAY['bec_fee_amount']->value = $bec_fees[2];
break;
case "nurse":
$ARRAY['bec_fee_amount']->value = $bec_fees[3];
break;
case "other":
$ARRAY['bec_fee_amount']->value = $bec_fees[4];
break;
case "member":
$ARRAY['bec_fee_amount']->value = $bec_fees[5];
break;
}
}


Where am I wrong as it is the same script I execute in the old form of Seblod? May be there is a bug with this plugin, or something totally different using it.
Waiting for some help.
Thanks in advance!

Get a VIP membership
9 years ago
1
Level 1

Hi Syreia Plus Ltd,

I think it's your variable $ARRAY, which is no good.

In new SEBLOD, the fields array is : $fields.


For exemple :
if($fields['bec_unique_id']->value == "1000") {......


Regards.

Lionel

9 years ago
0
Level 2

Hello Lionel and thank you very much for your help!

But still it`s not working:( 

I`ve made these changes - not $ARRAY but $fields, but still there is nothing transferred to the email text placeholders. I think that the new values are not being rendered (stored) at all.
Any other advice?

Regards!

9 years ago
0
Level 1

Hi Syreia,

have you make a dump the array $fields to be sure that you have all data you need to generate your email ?


Regards.

Lionel

Get a Book for SEBLOD