One moment, we're cooking some code examples
Setup your configuration
The e-commerce plugin is highly configurable. Most settings can be defined in the dashboard itself, some settings must be configured in the local configuration file.
In this configuration guide we handle all configuration options.
The e-commerce plugin supports 2 modes: catalog mode and e-commerce mode. You can switch modes in the general plugin settings within the dashboard.
The catalog mode provides a full categorized mode to display your products. Including product templates and product filters. Basicly everything you require to showcase your products, but without the e-commerce options.
The e-commerce mode add more configuration options like multiple shopping carts, advanced pricing, price rules, stock allocation and much more.
The catalog mode can be used for free. If you want to use the e-commerce mode, you require a valid license key.
Once the plugin has been installed, you want to check the default plugin configuration.
A configuration file (php) has been added to the /config
location of your application.
In this file you can configure your filters, carts and sale type settings. Multiple carts can be added, for example:
A cart in this example is just a place where the user can store products. What you want to do with a cart can be configured in the sale type settings.
A sale type handles what will happen with the cart once the user checks out. You can forward the user to a payment (in case of a regular checkout) or just send the user a confirmation mail (adding to favourites, or pick-up in store),
In the example below there is a barebones version of the webshop.php
config file. This will set up a default cart with checkout:
Link: Read more about setting up carts here
Before you can add categories to your catalog, you'll need add a structure item to connect with the e-commerce plugin.
In the dashboard click add sub item to your structure and select Plugin
A list of plugins will appear, select TypeStack e-commerce to continue.
Give your item a name and use the Default template to setup your catalog.
You can change your catalog template settings later.
Once you've connected the plugin to a structure item, you can add your first categories from the e-commerce dashboard. Just like adding (and dragging) regular menu-items.
Before you can add products to your catalog, you'll need to set up your first product template.
There are 2 type of product templates: main templates and sub templates.
The main templates defines generic information and features about your products.
In the dashboard go to Manage catalog Templates and features and create a main template.
If you sell electronics, you don't have to create a main template for each type of electronics. Just create a main template for all "electronics" and define all generic features like "brand" and "product type".
You can create a product sub templates for specific product type configurations like "televisions", "computers", "telephony", etc..
You can now edit your main template. Select the template from the dashboard and a new group.
Usually you want to your first group to contain some generic features. Create a group called generic features.
You now can add features to your new added group. Start by adding generic features like brands and product type. If needed, you can always add more features.
Keep features as generic as possible!
When you want to specify more features for specific product types, you can create a sub template later.
Once you've create a main template, you can start adding product sub templates.
The sub templates defines specific information about features and values in the main template. You always connect a sub template to one of the main features.
Main features are common features shared throughout all products. Think of features like: brands, product type, etc...
In the dashboard go to Manage catalog Templates and features and create a sub template.
Connect your new sub template to a main template and select matching features from the main template.
If you sell electronics like televisions, you can now add a sub template with specifications for televisions.
Create a product sub template and add features like "screen size", "screen type", "screen resolution", "HDR support", etc..
If you want more control over the features within a sub template, you can create multiple feature groups that can be shared and reused within sub templates.
You can start adding features to your sub template. Select the template from the dashboard and a new group.
Usually you want to your first group to contain generic items. Create a group called generic features. This group can usually contain generic features like barcode, weight, color, etc...
As there are common features for sub templates, there's a great chance you want to specify some brand specific features.
You can reuse feature groups from other sub templates to create a new sub template. This way you can completely customize any product the way you want.
To show your products, you also need to add 2 structure templates to display the catalog and the product details.
Open
Repeat this step to add a default product template
Text here
Text here
These templates need to be created during installation (!)
Several files
Some of these files will become settings in the dashboard itself.
Most required JavaScript and CSS can be included by just activate the plugin. Make sure to refresh the JS and CSS files. You can append the ?bClearCache
trigger to any URL to force this process. Or purge the cache from the dashboard giving you full control.
There is only one PHP configuration file located in the main config directory. This file contains basic webshop configuration and advanced cart configuration.
To display the catalog and the products, there are several template files. These template files contain basic HTML layouts and some additional code to prepare the request.
/assets/custom/plugins/typestack.webshop/templates/category/productlist.template.php
/assets/custom/plugins/typestack.webshop/templates/category/productblock.template.php
The catalog mode can be used for free. If you want to use the e-commerce mode, you require a valid license key.