Loading

There are 3 helpers for generating the certificates:

  • {shopGiftcertificatesPluginHelper::generateCertificate($params)} - returns array of the certificate data.
    You have to process the certificate data.
  • {shopGiftcertificatesPluginHelper::generateCertificateTemplate($params)} - returns HTML-code of the certificate template.
  • {shopGiftcertificatesPluginHelper::generateOneCertificate($params, $validation_types, $return_template)} - creates only one certificate depending on the validations. Returns array of data or the HTML-template. Read about the features of that helper.

The first 2 helpers create certificates on each call.

Params

In order for the certificate to be generated, you must pass the correct parameters to the helper.

Consider the array $params:


Consider the array $validation_types:


Consider the parameter $return_template:


Examples

If you cannot understand why state_id has value 19, read the article about the states.

Simple certificate with a discount $50.


Private user certificate


Will only be generated for an authorized user.

Email certificate


It will be attached to the email address.

Certificate with a lifetime of 10 days and $100.

Get an array of data and output only the certificate code.


Free products with a minimum order amount of $500 and lifetime for 10 days


In this example, 5 free products are attached: 2 products, 3 skus.

A certificate that will only be generated once for the user


A certificate that will only be generated once. Checking session or cookies

Get an array of data and output only the certificate code.


Certificate with custom code

Create the certificate with the code "Black friday!".


Where it can be used?

Certificates can be generated in notifications, mailings, after successful checkout, and so on. Read more in the article examples of certificate's generating.

Posted: November 14, 2020
0
Feedback form

Fill the form, and we will contact you.

Your name:
Email
Message: