Skip to main content

AddError

Short description

Allows you to display an error message. All error messages are managed here: Setup » Client » Settings » Languages

Description of this function

AddError( int $_errorCode  , string $_errorMessage  ) : bool

Examples

{%

	# Example for ValidatorPlaceOrder
	if(!$TermsAndConditionsCheck)
	{
		$_errorCode = 16; # Please read our General Terms and Conditions and confirm them by selecting the choice box.

		AddError($_errorCode);
	}


	# Example for ValidatorCustomerShippingAddress
	$_shippingAddress = GetCheckoutCustomerShippingAddressFromRequest();

	if(strlen($_shippingAddress->FirstName) < 2
		|| strlen($_shippingAddress->LastName) < 2)
	{
		$_errorCode = 39; #Please enter name and surname.

		AddError($_errorCode);
	}

%}
To top