# Magento 2 Sample Product

### <span style="color: #3b82f6;">Installation and User Guide for Magento 2 Sample Product extension</span>

**Table of Contents**

1. [*Installation* ](#bkmrk-installation)
    - *Installation via app/code*
    - *Installation via Composer*
2. [*Configuration Settings for Sample Product*](#bkmrk-configuration-settin)
    - *General Settings*
    - *Sample Product Settings*
3. [*Configure a Sample Product* ](#bkmrk-configure-a-sample-p)
    - *Free Sample*
    - *Sample with Cost Associated*
4. [*Sample products are not Eligible for Coupon Discounts* ](#bkmrk-sample-products-are-)
    - *Coupon Code Validation for Free Sample Product*
    - *Coupon Code Validation for Sample with Cost Associated product*
5. [*Email Received for a Sample Product* ](#bkmrk-configure-a-sample-p)

### <span style="color: #3b82f6;">Installation</span>

- <span style="color: #f97316;">**Installation via app/code:**</span> Upload the content of the module to your root folder. This will not overwrite the existing Magento folder or files, only the new contents will be added. After the successful upload of the package, run below commands on Magento 2 root directory.
    
    ```
    php bin/magento setup:upgrade
    php bin/magento setup:di:compile
    php bin/magento setup:static-content:deploy
    ```
- <span style="color: #f97316;">**Installation via Composer:**</span> Please follow the guide provided in the below link to complete the installation via composer.

<p class="callout success">[https://docs.scommerce-mage.com/magento-2-extensions/installation-via-composer/installation-via-composer](https://docs.scommerce-mage.com/magento-2-extensions/installation-via-composer/installation-via-composer)</p>

### <span style="color: #3b82f6;">Configuration Settings for Sample Product</span>

Go to **Admin &gt; Stores &gt; Configuration &gt; Scommerce Configuration &gt; Sample Product**

#### <span style="color: #f97316;">General Settings</span>

- **Enabled –** Select "Yes" or "No" to enable or disable the module.
- **License Key –** Please add the license for the extension which is provided in the order confirmation email. Please note license keys are site URL specific. If you require license keys for dev/staging sites then please email us at <support@scommerce-mage.com>.

[![image (52).png](https://docs.scommerce-mage.com/uploads/images/gallery/2025-05/scaled-1680-/image-52.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-05/image-52.png)

#### <span style="color: #f97316;">Sample Product Settings</span>

- **Enabled –** Select "Yes" or "No" to enable or disable the module.
- **License Key –** Please add the license for the extension which is provided in the order confirmation email. Please note license keys are site URL specific. If you require license keys for dev/staging sites then please email us at <support@scommerce-mage.com>.
- **Default Free Sample Text –** Please add the Default Free Sample Text
- **Default Sample with Cost Associated Text –** Please add the Default Sample with Cost Associated Text
- **Default Sample Price with Cost Associated -** Please add the Default simple price with cost associated
- **Default Max Qty to order samples -** Please add the Default max qty to order samples

[![image.png](https://docs.scommerce-mage.com/uploads/images/gallery/2026-01/scaled-1680-/image.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2026-01/image.png)

### <span style="color: #3b82f6;">**Configure a Sample product**</span>

- #### <span style="color: rgb(0, 0, 0);">**Free Sample**</span>

Log in to the Admin Panel and navigate to **Catalog → Products**. Select the product you want to edit and click **Edit**. Scroll down to the **Sample Product** section and choose **Free Sample** from the **Sample Type** dropdown.

**1. When the fields are empty**

If all fields are left blank, the system will use the default configuration values.  
On the frontend product page:

- The default quantity of **3** is applied, allowing the item to be added to the cart.
- The label **Free Sample** is displayed (e.g., for product *24‑WB07*).

[![image.png](https://docs.scommerce-mage.com/uploads/images/gallery/2026-01/scaled-1680-/Cnoimage.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2026-01/Cnoimage.png)

[![image.png](https://docs.scommerce-mage.com/uploads/images/gallery/2026-01/scaled-1680-/t4oimage.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2026-01/t4oimage.png)

[![image.png](https://docs.scommerce-mage.com/uploads/images/gallery/2026-01/scaled-1680-/3s1image.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2026-01/3s1image.png)

**2. When the fields have values set**

If any fields in the **Sample Product** section contain values, those product‑level values override the defaults and are used on the frontend.

[![image.png](https://docs.scommerce-mage.com/uploads/images/gallery/2026-01/scaled-1680-/iapimage.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2026-01/iapimage.png)

[![image.png](https://docs.scommerce-mage.com/uploads/images/gallery/2026-01/scaled-1680-/xOVimage.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2026-01/xOVimage.png)

[![image.png](https://docs.scommerce-mage.com/uploads/images/gallery/2026-01/scaled-1680-/uZSimage.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2026-01/uZSimage.png)

[![image.png](https://docs.scommerce-mage.com/uploads/images/gallery/2026-01/scaled-1680-/tFcimage.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2026-01/tFcimage.png)

- #### **Sample with Cost Associated**

Log in to the Admin Panel and go to **Catalog → Products**. Open the product you want to update by clicking **Edit**. Scroll down to the **Sample Product** section.

From the **Sample Type** dropdown, select **Sample with Cost Associated**.

- If you leave all fields empty, the system will automatically use the default price, title, and quantity from the configuration settings.

[![image.png](https://docs.scommerce-mage.com/uploads/images/gallery/2026-01/scaled-1680-/PQCimage.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2026-01/PQCimage.png)

[![image.png](https://docs.scommerce-mage.com/uploads/images/gallery/2026-01/scaled-1680-/t4oimage.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2026-01/t4oimage.png)

[![image.png](https://docs.scommerce-mage.com/uploads/images/gallery/2026-01/scaled-1680-/8Czimage.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2026-01/8Czimage.png)

- If you enter values in these fields, the system will use the product‑level values set in the **Sample Products** section instead.

[![image.png](https://docs.scommerce-mage.com/uploads/images/gallery/2026-01/scaled-1680-/wEiimage.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2026-01/wEiimage.png)

[![image.png](https://docs.scommerce-mage.com/uploads/images/gallery/2026-01/scaled-1680-/3arimage.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2026-01/3arimage.png)

[![image.png](https://docs.scommerce-mage.com/uploads/images/gallery/2026-01/scaled-1680-/AoBimage.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2026-01/AoBimage.png)

[![image.png](https://docs.scommerce-mage.com/uploads/images/gallery/2026-01/scaled-1680-/8tfimage.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2026-01/8tfimage.png)

### <span style="color: #3b82f6;">**Sample Products are not Eligible for Coupon Discounts**</span>

- #### <span style="color: #000000;">**<span data-teams="true">Coupon Code Validation for Free Sample Product</span>**</span>

Log in to the Admin Panel and go to **Marketing → Cart Price Rules**. Create a new coupon code, for example **“testcode”**. When you apply this coupon on the frontend for the sample products, it should display a validation error, even if the code itself is valid, because coupon codes are **not meant to work for sample products**

<span style="color: #000000;">**[![image.png](https://docs.scommerce-mage.com/uploads/images/gallery/2026-01/scaled-1680-/QlEimage.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2026-01/QlEimage.png)**</span>

[![image.png](https://docs.scommerce-mage.com/uploads/images/gallery/2026-01/scaled-1680-/Oehimage.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2026-01/Oehimage.png)

- #### <span style="color: #000000;">**<span data-teams="true">Coupon Code Validation for Sample with Cost Associated product</span>**</span>

We’ve created a coupon code called **“testcode”** in the Admin Panel. This code works normally for regular products, but it **won’t apply to the Sample product (e.g. 24‑WB07)**. When a customer tries to use the coupon code for the sample products, the system will show a validation message saying the code isn’t valid.

[![image.png](https://docs.scommerce-mage.com/uploads/images/gallery/2026-01/scaled-1680-/QlEimage.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2026-01/QlEimage.png)

[![nzbimage_1.png](https://docs.scommerce-mage.com/uploads/images/gallery/2026-02/scaled-1680-/nzbimage-1.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2026-02/nzbimage-1.png)

<div id="bkmrk--20"></div>### <span style="color: #3b82f6;">**Email Received for a Sample Product**</span>

<span style="color: #3b82f6;">**[![MicrosoftTeams-image (1).png](https://docs.scommerce-mage.com/uploads/images/gallery/2026-02/scaled-1680-/microsoftteams-image-1.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2026-02/microsoftteams-image-1.png)**</span>

If you have a question related to this extension please check out our [**FAQ Section**](https://www.scommerce-mage.com/magento-2-sample-products.html#customfaq) first. If you can't find the answer you are looking for then please contact [**support@scommerce-mage.com**](mailto:core@scommerce-mage.com)**.**