SilverCart Forum
We moderate this Forum and we're here to help. Have you already run a forum search to check if your problem has already been solved?
You can help us helping you by providing detailed error messages, screenshots and logfile entries.
Page: 1 , 2 | ||
Topic CustomHtmlForm module - success message | 5468 Views |
Re: CustomHtmlForm module - success message
3 October 2011 at 12:42pmhello Roland,
how can i setup custom submit button title on multilingual site, pls.?
Best regards
Pali
Re: CustomHtmlForm module - success message
3 October 2011 at 6:03pmHi Pali,
take the contact form as an example. If you look into the file SilvercartContactForm.php you see the following:
/**
* form settings, mainly submit button´s name
*
* @var array
*
* @author Roland Lehmann <rlehmann@pixeltricks.de>
* @since 02.02.2011
* @return void
*/
protected $preferences = array(
'submitButtonTitle' => 'Nachricht senden'
);
/**
* logged in users get there fields filled
*
* @return void
* @author Roland Lehmann <rlehmann@pixeltricks.de>
* @since 21.10.2010
*/
protected function fillInFieldValues() {
$this->formFields['Salutation']['title'] = _t('SilvercartAddress.SALUTATION');
$this->formFields['Salutation']['value'] = array(
'' => _t('SilvercartEditAddressForm.EMPTYSTRING_PLEASECHOOSE'),
"Frau" => _t('SilvercartAddress.MISSES'),
"Herr" => _t('SilvercartAddress.MISTER')
);
$this->formFields['FirstName']['title'] = _t('SilvercartAddress.FIRSTNAME', 'firstname');
$this->formFields['Surname']['title'] = _t('SilvercartAddress.SURNAME');
$this->formFields['Email']['title'] = _t('SilvercartAddress.EMAIL', 'email address');
$this->formFields['Message']['title'] = _t('SilvercartPage.MESSAGE', 'message');
$this->preferences['submitButtonTitle'] = _t('SilvercartPage.SUBMIT_MESSAGE', 'submit message');
$member = Member::currentUser();
if ($member) {
$this->formFields['Salutation']['selectedValue'] = $member->Salutation;
$this->formFields['FirstName']['value'] = $member->FirstName;
$this->formFields['Surname']['value'] = $member->Surname;
$this->formFields['Email']['value'] = $member->Email;
}
}
With this->preferences['submitButtonTitle'] the submit button gets a multilingual label.
Re: CustomHtmlForm module - success message
3 October 2011 at 8:44pmhello Roland,
great, helped so much ;)
Have a nice evening
pali
Re: CustomHtmlForm module - success message
1 May 2012 at 6:05pmI have an issue with the final order button.
My shop is in French. This final order button shows no value (it's just a little quare, not really appealing :) !).
It's title is "Abschicken" so I searched in the customHTMLform files and found this function in CustomHtmlForm.php.
protected $basePreferences = array(
'submitButtonTitle' => 'Abschicken',
'submitButtonToolTip' => 'Abschicken',
...
);
I changed the first two values to "Envoyer" and it changed the title of the button, but it still has no value.
Adding the line (below) in the fillInFieldValues function gets other buttons to have the same message (the + and - in the cart, for instance !)
$this->preferences['submitButtonTitle'] = _t('SilvercartPage.SUBMIT_MESSAGE', 'submit message');
Any idea on how to add a value just to this last order button ?