This is the documentation for LemonStand V1, which has been discontinued. You can learn more and upgrade your store here.

LemonStand Version 1 Has Been Discontinued

This documentation is for LemonStand Version 1. LemonStand is now offered as a cloud-based eCommerce platform.
You can try the new LemonStand and learn about upgrading here.

Customizing Invoices Templates

Invoices, packing slips and shipping labels in LemonStand are customizable. You can implement literally any invoice, packing slip or shipping label template, making printable documents consistent with your company identity.

Templates are situated in the following directories:

  • modules/shop/invoice_templates - invoices
  • modules/shop/packingslip_templates - packing slips
  • modules/shop/shippinglabel_templates - shipping labels

Each subdirectory in these directories represents a single template. LemonStand includes standard templates (directories which begin with the ls_standard prefix). Please do not edit the standard templates, because they will be overwritten on next software update.

Creating a new invoice template

To create a new invoice template, create a copy of the ls_standard directory in the modules/shop/invoice_templates directory. Assign some meaningful name to a new directory. Inside the directory, edit the info.php file. This file contains information about the template. You can change the template name and description, and specify CSS files which you need to be linked on the Invoice page. The LemonStand Standard invoice template contains the standard.css file, which is already specified in the info.php file.

<?
  $template_info = array(
    'name'=>'LemonStand Standard invoice',
    'description'=>'Standard LemonStand invoice',
    'css'=>array(
      
      /*
       * A list of CSS files and media types to link to the invoice page.
       *
       * Use only file names if you need to link a CSS file from the 
       * template resources/css directory:
       * 'standard.css'=>'all'
       *
       * Use absolute paths if you need to link external CSS files:
       * 'http://www.url.com/resources/css/print.css'=>'print',
       * 'http://www.url.com/resources/css/screen.css'=>'all'
       */

      'standard.css'=>'all'
    )
  );
?>

Save the updated info.php file and open the invoice.htm file in a text editor. This file contains the invoice page content. You can edit the file, and create, or update CSS classes in your template CSS file(s). Feel free to completely empty the template CSS file and begin from scratch. LemonStand provides a number of PHP variables which you can use in the invoice template:

  • $order - represents an order, corresponding a current invoice. An object of the Shop_Order class
  • $company_info - PHP object, containing information about your company. You can edit the company information on the System/Settings/Company Information and Settings page.
  • $invoice_template_info - information
  • $invoice_date - Phpr_DateTime object, containing the invoice date. The invoice date depends on invoice configuration. In some cases the invoice date is not known (the variable contains NULL value). Always check the variable before displaying its value.
  • $display_due_date - a Boolean-type variable, which determines whether a Due Date should be displayed. You can manage the Due Date visibility on the Invoices tab of the System/Settings/Company Information and Settings page.
  • $due_date - Phpr_DateTime object, containing an invoice due date. In some cases the due date is not known (the variable contains NULL value). Always check the variable before displaying its value.
  • $display_tax_included - a Boolean-type variable. Determines whether product prices should include tax.

You can use the standard template implementation as a reference, and update it according to your needs (but please make a copy of the standard template before you begin and work with it, because changing the standard templates is not allowed). There are no "required" code in the standard template, so you can empty the invoice.htm file and develop your own invoice implementation from scratch.

After creating a new invoice template, you should select it on the Invoices tab of the Company Information and Settings page.

Next: Creating a New Shipping Label Template
Previous: Order Details Page for Inclusive Tax Environments
Return to Order History, Status, and Details