Redeem Now
Read More
Read now
Menu Close
    Start a Project Request quote Reading list Switch to dark mode
    Blog Version - 1.7.x.x
    • Version 1.7.x.x
    • Version 1.6.x.x

    Prestashop Sample Product

    Do you want your customers to quickly and easily buy a sample version of a product? Prestashop Sample Product gives your customer an additional feature to buy a sample of any standard product so that he or she may try the product before committing to a purchase. On the product page, customer will find a button which would enable them to buy a sample of the product.

    Features of Prestashop Sample Product

    • Provide a sample of your existing products to customers.
    • Customers can try a product before purchasing it.
    • Admin can allow/restrict the guest users to buy sample product.
    • Either define a price for your sample products or offer free samples.
    • Limit the number of samples a customer can purchase.
    • Choose to show or hide the quantity selector for sample product.
    • Allow or restrict only logged-in users to order sample product.
    • Customize the text and the background colour of the ‘buy sample’ button.
    • Now, customers can order sample of any combination of the product.
    • Configure global settings to offer a sample of all the products of the catalog.
    • Enable/disable tax on the purchase of a sample product.
    • Offer sample version of virtual products too.
    • Upload another file for sample virtual product for preview.
    • The main product can not be added while its sample is already in cart.
    • A new label to notify sample product will show in cart.
    • Buyers can even choose the quantity of sample product.
    • The module is multi-shop compatible.

    How to install Prestashop Sample Product module

    • Firstly, Go to the Module Manager in Back office and click on ‘upload a module’.
    • After that, Drag and drop the module file or select the file from the system.
    • In this way, the module installation will be successful.


    1) To enable selling of sample of virtual products, add a new custom hook in /controllers/front/GetFileController.php for downloading virtual product sample:
    * Just before line:  *$mimeType = false;*

    Add this line

    2. If you want to enable “Minimum quantity for sale” for sample products then add a new custom hook in

    /classes/Cart.php::updateQty() for adding sample quantity less than product minimum quantity
    * Replace the code –

    With –

    3) If you are using Prestashop V1.7.5.0 or above, then make following change for adding sample less than minimal quantity:
    * Replace the code in processChangeProductInCart() in /controllers/front/CartController.php

    With –

    Configuring the module

    In order to allow purchase of sample product at the shop, firstly you need to configure the module. So, let’s see what all options do we have in the configuration settings?

    In the basic configuration part, you can-

    • Set maximum number of sample product that a customer can order in a single order.
    • Choose to update stock on the order of the sample product.
    • Allow only logged-in users to order sample product.
    • Show or hide the quantity selector box for sample product.
    • Customize the text and the background colour of the ‘buy sample’ button.

    For guest users

    As per the configuration, guest users can not buy sample of the product.

    Apart from this, there is a configuration setting for the global sample too. Here, global sample simply refers to sample product for every product of the store. In case, if you enable global sample, then sample for each & every product will be available for customers. And, customers can buy them.

    Additionally, it also contains some extra setting like:

    • The maximum quantity of sample that a customer can buy in a single cart.
    • Price type i.e. how a customer will be charged for sample product.
    • Text to show on ‘buy sample’ button & description of the sample product.

    Note: Please note that the setting for the global sample will work on all the products. However, if you have set any other setting for the product individually, then the global setting will not work for this product. Other products will still follow global settings.

    The workflow of the module

    Admin can now associate the Sample products with their Standard products. Steps to offer Sample products of a particular standard product. Go to Catalog -> Products -> Add New Product -> Modules.

    On clicking Configure button, admin can set the configurations of a sample product associated with the standard product.

    Note-: We have 5 different ways to display a price of a standard product A) Product Actual Price B) Deduct fix amount from product price C) A Percentage of product price D) Custom Price E) Free Sample

    Price Type is set to Product Actual Price, the front end will display as:

    In Front end it will display as:

    When Price Type is set to Deduct fix amount from product price

    In Front end it will display as:

    When Price Type is set to A Percentage of product price

    In the front end it will display as:

    When a Price Type is set to Custom Price

    In the front end it will display as:

    When a Price Type is set to Free Sample

    In Front end it will display as:

    Now, customer buys the sample of BROWN BEAR NOTEBOOK . The admin has set the price type of a sample to Deduct fix amount from product price. 

    Note-: The customer cannot add the standard product and its sample to the cart at same time. He/she can buy only one at a time.

    Cart Popup

    Cart Page

    Once the customer purchases the sample, admin can view the details under the “Orders” tab in the back office.

    On clicking View Button

    Note-: You can add samples of 2 different products only to the cart. Sample of any 3rd product will not be added as per the configurations set by the admin in the back office.

    Buy a sample of any combination of the product

    Earlier, a buyer can only buy sample of the default combination of the product. Now, they can buy sample of any combination of the product. In order to do so, a customer just needs to select the combination & then click on “Buy Sample” button.

    As you can see, the cart contains sample of two different combinations of the same product.

    In this way, a customer can now order sample for any combination of the product.

    Process to buy sample of virtual product

    Virtual Product:- Process to buy sample of the virtual product is explained in screenshots given below.

    Admin needs to attach associated file for main product then only he/she will be able to attach sample file to the product. In case if admin attached main file & forgot to attach sample file then customer will not be able to download sample file if he/she placed an order for sample product.

    Admin can add(if he/she wants to) another file for sample for preview.

    In case, customer wants to buy sample of a virtual product, he/she will need to repeat same process for buying sample.

    Admin can easily check at his back-end whether placed order was for main product or for sample. A block will notify about order of sample product as depicted in picture below.

    After admin accepts the payment, a customer can download the sample file of the virtual product. Customers can download the file from the order details page.

    Note: “If a sample file is attached to a virtual product, then only this file will be provided as a sample for all combinations of this virtual product. Also, you cannot attach a global sample file for all the virtual products of the store.”

    This was all about Prestashop Sample Product Module. I hope this document will help you in checking the functionality of the module in a better way. Also, do let us know about your views in the comments.


    For any kind of technical assistance, just raise a ticket at and for any doubt contact us at

    Current Product Version - 5.1.0

    Supported Framework Version - 1.7.x.x

    . . .

    Leave a Comment

    Your email address will not be published. Required fields are marked*

    Be the first to comment.

    Back to Top
    Hire Us!
    Brief us about your requirements and we'll get back to you.
    Woo! Hooy!
    We have just recieved your project brief and our expert will contact you shortly.
    Send Again

    Table of Content

    Hide Index