OpenCart Samples

Allow your customers to order sample products before purchasing the full items on your website

Buy Now Ticket Support E-Mail Support

This modification is ideal for stores that sell fabrics, tiles, paint, food, drinks or in fact any item where someone can buy a sample of a full product at a reduced cost. Simple configuration and no need to clone your items to create the sample products unlike other inferior alternatives

Before you start the installation process, ensure you have the following

Once you've set the status of the module to ENABLED in the module, you can then edit a product (CATALOG > PRODUCT then hit EDIT in your admin next to a product), and should be presented with a new "Sample" tab. From here, you can enable a sample for that specific product, and optionally set it's price, weight and model. If you leave any of these as their defaults, the global value used in the module configuration page will be used instead

There are three possible ways to disable the extension, with each being more severe than the last

Status: Disabled for the modification

Setting this to disabled will globally disable all samples and prevent you from editing any products sample settings (though the details will be retained in the database)

Disable all sample products

This is done simply by going to the module configuration (EXTENSIONS > MODULES > EDIT next to Samples (JG)), and using the "Disable all samples" button on the TOOLBOX tab. This will change any products with samples enabled to become disabled. Note that you will have to manually enable each of these again manually one at a time if you only have specific products that will be samples. Otherwise you can use the Enable all samples button in the toolbox to enable them all again


This is done by clicking the UNINSTALL option in EXTENSIONS > MODULES next to Samples (JG). This will remove ALL DATA associated with the modification, including removing all database table columns that are added with the installation. Once you have done this, you will also need to remove the vQmod file associated with the extension, which can be found in your /vqmod/xml folder named "jg_sample.xml". Not doing this will cause error messages in your catalog side due to missing database columns. Should you wish to re-enable the extension you will need to re-upload this file

Adding the Add Sample button to custom themes

For those not using the default theme, adding the "Add Sample" button to your product page template is pretty straight forward.  Open catalog/view/theme/your-theme-name/template/product/product.tpl and place this code where you want the button to appear

<?php if($sample_enabled) { ?>&nbsp;<input type="button" value="<?php echo $button_sample; ?>" id="button-sample" class="button" /><?php } ?>

Note that you can edit the HTML for this as much as you want but the ID needs to remain as button-sample in order for it to be clickable and add the sample

Additional customisation

If you require any further customisation made to this module by myself, please submit a ticket using the button at the start of this documentation. I charge USD $100/hour for custom works, however I can provide a fixed fee for smaller jobs upon request