Welcome, Guest
Username: Password: Remember me

TOPIC: [HOW TO] Alert message before to direct

[HOW TO] Alert message before to direct 10 years 6 months ago #1248

  • juliodom
  • juliodom's Avatar
I would need that my customers accept a conditions agreement text before to order. I think that an alert message with accept option would be a good solution. Could you help me?

Thanks in advance.

P.S.: May be this could be a interesting feature to include in future releases...
The administrator has disabled public write access.

[HOW TO] Alert message before to direct 10 years 6 months ago #1249

  • juliodom
  • juliodom's Avatar
I made this modification and it works for me. Let me know it this is correct.

At makeForm function of class.php file, change the code:
$onClick = 'document.getElementById(\'' . $uniqueId . '\').value = \'' . $pp[0] . '\' + String.fromCharCode(64) + \'' . $pp[1] . '\'; document.getElementById(\'' . $uniqueId . '0xff\').value = \'' . $pp[0] . '\' + String.fromCharCode(64) + \'' . $pp[1] . '\'; jQuery(\'#form_' . $key . '\').submit(); return true;';

to:
$onClick = 'if (confirm(\'' . JText::_('AGREEMENT_TEXT') . '\')) {document.getElementById(\'' . $uniqueId . '\').value = \'' . $pp[0] . '\' + String.fromCharCode(64) + \'' . $pp[1] . '\'; document.getElementById(\'' . $uniqueId . '0xff\').value = \'' . $pp[0] . '\' + String.fromCharCode(64) + \'' . $pp[1] . '\'; jQuery(\'#form_' . $key . '\').submit(); return true;}';

Previously you need to declare the AGREEMENT_TEXT at the language files.
The administrator has disabled public write access.

[HOW TO] Alert message before to direct 10 years 6 months ago #1250

  • admin
  • admin's Avatar
Hello,

Well done and thanks for sharing!

I am going to have a look at your other posts shorty I'm just waking up.

Thanks again!
The administrator has disabled public write access.
Time to create page: 0.050 seconds