User Manual - Simple eCommerce

A small, yet quality eCommerce package is also available with Envrin CMS. This package is great if you're selling a small handful of products / services such as hosting plans for example, but is not meant to sell a large catalog of products. To start, please ensure the package is installed on your system. Check to see if a Settings->Product Settings menu exists within your administration panel, and if not, go to the Maintenance->Package Manager menu, Available Packages tab, and install the package named ""Transaction - Simple eCommerce".


Product Settings

To begin, simply create the desired products / services you will be selling through the Settings->Product Settings menu. At the bottom of this menu, you will see a form that looks like:

Enter the desired product details in the form. The "Publicly Available" field determines whether or not the product is displayed in the list of available products when someone is making a purchase. The "Variable Amount" field should only ever be set to yes for things such as custom work, where you will be manually adding the purchases / invoices to the member's account. The recurring amount fields are optional, and only required if it's a recurring (eg. monthly) purchase.


Public Order Form

You can view the public order form at the /order page of the software (eg. http://yourdomain.com/order). This form is virtually the same as the registration form, except it also allows you to select a product to purchase. This form will create a new account for the customer, and charge them the appropriate fee for the selected product. However, if the user is already logged in, instead of seeing the registration form they will only see a message saying the new order will be added to their existing account.

If desired, you can specify the product being purchased by linking to /order?product_id=XX, where XX is the ID# of the product. For example, going to http://yourdomain.com/order?product_id=1 would be to purchase the product ID# 1. You can also get the full purchase URL be clicking on the "Purchase Link" link within the products table.

You may modify the look of the order form by modifying the file located at /data/tpl/public/order.tpl.


Member Area Order Form

If the user already has an account, they may also purchase products through the member's area. To do this, ensure the "Product Purchase" menu is added to the appropriate member area(s) via the Settings->Account Settings->Member Areas menu.


Executing PHP Code on Purchase

If wanted, you may also execute custom PHP code when a product purchase is submitted (pending), approved, declined, or refunded. Please note, this section is only applicable if you have a working knowledge of PHP. Through the Settings->Product Settings menu you will notice a "Developer Tools" link within the products table. Click on this link for the desired product, and you will be brought to a page where you can define the PHP code for the product.

  • Each product recieves its own PHP class, which is located at /data/product_code/XX.php, where XX is the ID# of the product.

  • The class name must be "simple_ecom_product_XX", where XX is the ID# of the product.

  • The class can contain four methods, pending(), approved(), declined(), refunded(), which are automatically executed upon the product being purchased. Each method accepts one $trans argument, which is the transaction object of the product purchase. Do a "print_r($trans);" to view all properties of this object.