Magento 2 Product Labels

Magento 2 Product Labels extension lets admin create and display attractive product labels to highlight discounts, new arrivals, etc., and boost sales in the Magento 2 store.

 

Table of Content

  1. Extension Installation Guide
  2. Configuration
  3. ‘Is New’ Condition
  4. Display Settings
  5. Manage Product Labels
  6. Product Labels in frontend

 

  1. Extension Installation
  • For Magento Marketplace Customers
    • Find the Composer name and version of the extension in the extension’s composer.json file.
    • Login to your SSH and run:
      • composer require meetanshi/magento-2-product-labels
    • Enter your authentication keys. Your public key is your username; your private key is your password.
    • Wait for Composer to finish updating your project dependencies and make sure there aren’t any errors.
    • To verify that the extension installed properly, run the command:
      • php bin/magento module:status Meetanshi_ProductLabels
          • By default, the extension is probably disabled.
          • Enable the extension and clear static view files:
      • php bin/magento module:enable Meetanshi_ProductLabels --clear-static-content
      • php bin/magento setup:upgrade
      • For Magento version 2.0.x to 2.1.x - php bin/magento setup:static-content:deploy
      • For Magento version 2.2.x & above - php bin/magento setup:static-content:deploy –f
      • php bin/magento cache:flush
         
  • For Meetanshi Customers
  • Extract the zip folder and upload our extension to the root of your Magento 2 directory via FTP.
  • Login to your SSH and run below commands step by step:
  • php bin/magento setup:upgrade
  • For Magento version 2.0.x to 2.1.x - php bin/magento setup:static-content:deploy
  • For Magento version 2.2.x & above - php bin/magento setup:static-content:deploy –f
  • php bin/magento cache:flush

 

  1. Configuration
    To configure the extension, login to Magento 2 backend, move to Stores à Configuration à Meetanshi à Product Labels where you can find various settings to configure the extension.
  • Product Labels: Enable the Product Labels extension from here.
  • Show Multiple Labels on Product: Select YES to display multiple Labels on Product
  • Show “Out of Stock” Label only for Out of Stock Products: Select YES to display “Out of Stock” label only for Out of Stock Products only.
  • Exclude Pages for Labels Display: Select the pages to exclude from displaying product labels.


 

  1. ‘Is New’ Condition
    While using product conditions as New to show product labels, you need to specify how to consider the product as new. Select one of the options below for the same.
  • Is New: Select how you want to consider products as new:
    • Is New Attribute: Considers product as new if the “Is New” attribute is set to Yes from the product edit section.
    • Use “New from Date” and “New to Date”: Considers product as new based on “new from date” and “new to date” specified under the product edit.

    • Created Date: Considers product as new based on product creation date.

 

 

  1. Display Settings
  • Product Page Label Container: Add the specific product page label container according to your current theme.
  • Product List Label Container: Add the specific category page label container according to your current theme.

 

 

 
  1. Manage Product Labels
    The extension facilitates a separate backend grid to manage all the already created and saved product labels.


 

 

 
  • Add New Label – Text Only Type
    With the product labels extension, you can create new label on click of “Add New Label”.
    • Name: Add new label name.
    • Status: Enable the product label from here.
    • Label Type: Select product label type, here text only.
    • Label Text: Enter product label text. You can use the variables listed under the comment.
    • Text Color: Set text color for the product label.
    • Text Font Size: Enter the text font size in pixels.
    • Label Position: Set Label position to display the product label in frontend.
    • Label Preview: You can see the preview of product label accordingly. Even though preview has HTML tags, they will not be shown in the frontend.
    • Advanced Settings/CSS: Add advanced CSS if required.
    • Priority: Enter the priority of the product label.
    • Apply to Out-of-Stock Products: Select YES if you want to apply the product label for out of stock products.
    • Date From/To: Select the date range until which you desire to display the product label.
    • Store View: Select the store views to which you want to show product label.
    • Customer Group: Select the customer groups to which you want to show product label.
    • Add Condition: Add specific condition to show product label in frontend. (Note: Leave blank to show labels on all products.)

  • Add New Label – Image Type
  • Name: Add new label name
    • Status: Enable the product label from here.
    • Label Type: Select product label type, here upload image.
  • Label Image: Upload the product label image.
  • Label Position: Set Label position to display the product label in frontend.
    • Label Preview: You can see the preview of product label accordingly. Even though preview has HTML tags, they will not be shown in the frontend.
    • Advanced Settings/CSS: Add advanced CSS if required.
    • Priority: Enter the priority of the product label.
    • Apply to Out-of-Stock Products: Select YES if you want to apply the product label for out of stock products.
    • Date From/To: Select the date range until which you desire to display the product label.
    • Store View: Select the store views to which you want to show product label.
    • Customer Group: Select the customer groups to which you want to show product label.
    • Add Condition: Add specific condition to show product label in frontend. (Note: Leave blank to show labels on all products.)


  1. Product Labels in Frontend
    Once you have configured the extension successfully, product labels are shown in frontend based on their settings.