This plugin is intended for use by customers that already have the PSDBI package installed. The psdbi.cfg file is used by this plugin to connect to the default database.
This software package comes with three software components:
This package includes three HTML files:
This package includes three Email Template files:
This package includes three sample background images to use with gift certificate email:
Example plugin registration table before adding the Gift Certificate plugin:
%plugins =
(
# Calendar example plugin
'calendar' =>
{
'program' => 'ps_plugin_gencal.pl'
}
);
Example plugin registration table after adding the Gift Certificate plugin:
%plugins =
(
# Calendar example plugin
'calendar' =>
{
'program' => 'ps_plugin_gencal.pl'
},
'giftcert' =>
{
'program' => 'ps_plugin_giftcert.pl',
'module' => 'PS_GiftCert.pm',
'event' => '.*',
'display' => 'yes',
'cert_dir' => 'plugins/giftcert',
'cert_html' => 'giftcertemail.html',
'cert_issued' => 'giftcertissued.txt',
'cert_plain' => 'giftcertemail.txt',
'redeem_action' => 'thispage',
'redeem_page' => 'giftcertredeem.html',
'cc_webmaster' => 'no',
'init' => 'no'
}
);
'cert_html'
This setting contains the name of the HTML email template file that is used to generate the email that is sent to the
gift certificate recipient. This template will only be used if Perlshop has been configured to send email in HTML format.
This file is expected to be in the directory indicated by the 'cert_dir' setting.
This file contains Perlshop DBI commands. On-line documentation is available from the Waverider Systems web site.
'cert_plain'
This setting contains the name of the plain-text email template file that is used to generate the email that is sent to the
gift certificate recipient. This template will be used as the alternate plain-text email body when HTML email is enabled, and will also be used when Perlshop is configured for plain-text email.
This file is expected to be in the directory indicated by the 'cert_dir' setting.
This file contains Perlshop DBI commands. On-line documentation is available from the Waverider Systems web site.
'cert_issued'
This setting contains the name of the plain-text email template file that is used to genreate the email that is sent to the
gift certificate buyer.
This file is expected to be in the directory indicated by the 'cert_dir' setting.
This file contains Perlshop DBI commands. On-line documentation is available from the Waverider Systems web site.
'redeem_action'
Set this value to 'thispage' to enable the display of the gift certificate redemption link on shopping cart display screen. Leave this value out if you want to disable this feature. No other values are supported for this setting.
'redeem_page'
This is the name of the catalog page that will be loaded when the redemption offer link is clicked on.
'cc_webmaster'
The allowed values for this setting are 'yes' and 'no'. If set to yes, a copy of the gift certificate email will be
sent to the webmaster address specified in the ps.cfg file.
The ps_gift_cert table is expected to have the following form:
create table ps_gift_cert ( cert_id varchar(40), timestamp timestamp, status varchar(10), amount float, purchase_order varchar(40), purchase_name varchar(40), purchase_email varchar(40), recipient_name varchar(40), recipient_email varchar(40), recipient_order varchar(40), note varchar(250), activator varchar(40) )The table fields are defined as follows:
'cert_id'
This is a unique identifier used to identify a gift certificate. This identifier will be of the form
"orderid-number", where "orderid" is the order ID number used to purchase the gift certificate,
and "number" is a randomly generated six digit value.
'timestamp'
This is the date and time that the certificate was generated.
'status'
This is the current status of the gift certificate. This will be one of the following values:
'created' - This means the certificate has been created, but not yet purchased.
'issued' - This means the certificate has been purchased and issued to the recipient.
'used' - This means the certificate has been assigned to a shopping cart, but that the certificate has not yet been fully used.
'closed' - This certificate has been all used up.
'amount'
This is the current monetary value of the certificate. This is assigned by the buyer, and will be reduced each time the certificate is used.
'purchase_order'
This is the Perlshop order number under which the certificate was purchased.
'purchase_name'
This is the name of the certificate buyer, as taken from their Perlshop customer data.
'purchase_email'
This is the email address of the certificate buyer, as taken from their Perlshop customer data.
'recipient_name'
This is the name of the certificate recipient, as given by the certificate buyer.
'recipient_email'
This is the email address of the certificate recipient, as given by the certificate buyer.
'recipient_order'
This is the Perlshop order number that this certificate was last applied to by the recipient.
'note'
This is the gift certificate note provided by the buyer.
'activator'
This is the unique gift certificate activiation string generated by the plugin when the certificate was created.
The ps_gift_cert_log table is expected to have the following form:
create table ps_gift_cert_log ( cert_id varchar(40), timestamp timestamp, description varchar(120) )The table fields are defined as follows:
'cert_id'
This is a unique identifier used to identify a gift certificate. This identifier will be of the form "orderid-number", where "orderid" is the order ID number used to purchase the gift certificate, and "number" is a randomly generated six digit value.
'timestamp'
This is the date and time of the log entry.
'description'
This is the text of the log entry. A log entry will be made for each gift certificate when any of the following events takes place:
- Gift certificate creation
- Gift certificate purchase
- Gift certificate activated and assigned to a shopping cart
- Gift certificate used, some value remains for use on a later purchase
- Gift certificate all used up
There are two ways to create the database tables used by this plugin.
http://www.yoururl.com/yourcgipath/perlshop.cgi?action=init_plugin&plugin=giftcertNote: This action will only be allowed if the init setting in the plugin information to 'yes'. Once the database tables have been created, you should set the init setting in the plugin information to 'no'.
ps_giftcert_util.pl CREATEDB
Once created, the database tables can be cleared from the web server command line using this command:
ps_giftcert_util.pl CLEARDB
This program is run from the web server command line using the command "ps_giftcert_util.pl". If this command is entered with no command line arguments, the following usage instructions will be displayed:
Usage: ps_giftcert_util.pl command [file] {file}
where command is:
CREATEDB - Creates ps_gift_cert and ps_gift_cert_log tables.
CLEARDB - Delete all content from both tables.
report - Generates a status report
The database tables can be created from the web server command line using this command:
ps_giftcert_util.pl CREATEDB
Once created, the database tables can be cleared from the web server command line using this command:
ps_giftcert_util.pl CLEARDB
A simple database table dump can be achieved using the following command:
ps_giftcert_util.pl report
http://www.yoururl.com/yourcgipath/perlshop.cgi?action=selftest
'giftcertbuy.html'
This is a standard Perlshop catalog page file. It contains an example of using the Gift Certificate plugin to purchase a gift certificate. You should customize the cosmetic appearance of this page to suit the needs of your store. The names of the form fields used to call the plugin should not be changed. Each of the plugin form fields are detailed in a later section of this document.
'giftcertredeem.html'
This is a standard Perlshop catalog page file. It contains an example of using the Gift Certificate plugin to redeem a gift certificate. You should customize the cosmetic appearance of this page to suit the needs of your store. The names of the form fields used to call the plugin should not be changed. Each of the plugin form fields are detailed in a later section of this document.
'giftcertpreview.html'
This is a PSDBI catalog page file. It is used to present a preview of a gift certificate prior to adding it to a shopping cart. You should customize the cosmetic appearance of this page to suit the needs of your store. The PSDBI SQL statements and template variables used in this page should not be changed.
'giftcertemail.html'
This is the HTML email template file that is used to generate the email that is sent to the gift certificate recipient. This template will only be used if Perlshop has been configured to send email in HTML format.
This file is expected to be in the directory indicated by the 'cert_dir' setting.
This file contains Perlshop DBI commands. On-line documentation is available from the Waverider Systems web site.
'giftcertemail.txt'
This is the plain-text email template file that is used to generate the email that is sent to the gift certificate recipient. This template will be used as the alternate plain-text email body when HTML email is enabled, and will also be used when Perlshop is configured for plain-text email.
This file is expected to be in the directory indicated by the 'cert_dir' setting.
This file contains Perlshop DBI commands. On-line documentation is available from the Waverider Systems web site.
'giftcertissued.txt'
This is the plain-text email template file that is used to genreate the email that is sent to the gift certificate buyer.
This file is expected to be in the directory indicated by the 'cert_dir' setting.
This file contains Perlshop DBI commands. On-line documentation is available from the Waverider Systems web site.
Plugin parameter 1:
This value determines which mode of operation is being requested of the plugin. Legal values are "create" and "use".
Plugin parameter 2:
This is the current Order ID number.
Plugin parameter 3:
This is the value to use for the Perlshop "thispage" parameter on subsequent pages.
Plugin parameter 4:
This is the full name of the intended gift certificate recipient.
Plugin parameter 5:
This is the email address of the intended gift certificate recipient.
Plugin parameter 6:
This is the amount of the gift certificate.
Plugin parameter 7:
This is the text of the gift certificate note.
Plugin parameter 4:
This is the email address of the intended gift certificate recipient.
Plugin parameter 5:
This is the email address used to buy the gift certificate.
Plugin parameter 6:
This is the gift certificate number.
Plugin parameter 7:
This is the gift certificate activation code.
%office_tool_plugins =
(
# Gift Certificate Log report
'gift_cert_log' =>
{
'label' => 'Gift Certificate Log Report',
'module' => 'PSO_GiftCert.pm'
},
# Gift Certificate report
'gift_cert_report' =>
{
'label' => 'Gift Certificate Use Report',
'module' => 'PSO_GiftCert.pm'
}
);