Skip to main content

Magento 2 Sample Product

Installation and User Guide for Magento 2 Sample Product extension

Table of Contents

  1. Installation
    • Installation via app/code
    • Installation via Composer
  2. Configuration Settings for Sample Product
    • General Settings
    • Sample Product Settings
  3. Configure a Sample Product
  4. Sample Products are not Eligible for Coupon Discounts
  5. Email Received for a Sample Product

Installation

  • Installation via app/code: 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 php bin/magento setup:upgrade
    php bin/magento setup:di:compile
    php bin/magento setup:static-content:deploy
  • Installation via Composer: Please follow the guide provided in the below link to complete the installation via composer.

https://docs.scommerce-mage.com/magento-2-extensions/installation-via-composer/installation-via-composer

Configuration Settings for Sample Product

Go to Admin > Stores > Configuration > Scommerce Configuration > Sample Product

General Settings

  • 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

Sample Product Settings

  • 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

Configure a Sample product

  • Free Sample

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

image.png

image.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

image.png

image.png

image.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

image.png

image.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

image.png

image.png

image.png

Sample Products are not Eligible for Coupon Discounts

  • Free Sample

Login to the Admin Panel, navigate to Marketing > Cart Price Rules, and create a coupon code named “testcode”. When applied on the cart page, this coupon should not be valid for Sample product (24-WB07).

image.png

image.png

  • Sample with Cost Associated

Login to the Admin Panel, navigate to Marketing > Cart Price Rules, and create a coupon code named “testcode”. When applied on the cart page, this coupon should not be valid for Sample product (24-WB07).

image.png

nzbimage_1.png

 

Email received for a Sample product

MicrosoftTeams-image (1).png

If you have a question related to this extension please check out our FAQ Section first. If you can't find the answer you are looking for then please contact support@scommerce-mage.com.