Skip to content

Product Units and Quantities

Description

The product Units and Quantities module allow you to introduce your specific measurement units and make it more convenient for customers to order more at once. This can be done by using the dropdown, arrows, plus-minus, or slider instead of the standard Magento Quantity field. here are some key features that the module offers:

  • Set custom units for your product pages, shopping carts, and wishlists
  • Pick quantities for each product
  • Customise the quantity input field
  • Apply settings globally or individually

Compatibility

Product Units and Quantities module are compatible with the following Magento platforms:

Community Edition (Open Source) Enterprise Edition (Commerce) Cloud Edition
2.3.0 - 2.4.* 2.3.0 - 2.4.* 2.3.0 - 2.4.*

Installation

Installing module using zip file

  • Unzip and paste the extension file into your root Magento folder.
  • Connect to your server by SSH.
  • Go to your Magento root folder.
  • To install the extension, perform this command:
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy

Composer installation

If you haven't installed any Aitoc module before, in that case first you will need to add your Aitoc composer repository. Please go through the document to see how you can add composer repository.

To install the module, you will need to run following commands:

composer require aitoc/product-units-and-quantities
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
  • To switch the extension on/off, perform these commands:
php bin/magento module:enable Aitoc_ProductUnitsAndQuantities
php bin/magento module:disable Aitoc_ProductUnitsAndQuantities
  • To update the module, use below command:
composer update aitoc/product-units-and-quantities

Config Settings

STORES > SETTINGS - CONFIGURATION > AITOC EXTENSIONS > PRODUCT UNITS AND QUANTITIES > GENERAL SETTINGS

Note

Here you can manage the settings of the extension.

Note

Select different input options (Dropdown, Slide, Plus Minus, Arrows) to change the default input of the QTY field on product pages.

Note

Go to the ‘Use quantities’ field to specify default quantities for products available in your online store.

Note

Select the value ‘Yes’ in the ‘Allow units’ field and set the default product unit name (e.g., 5 pieces) to be displayed on the product pages’ QTY input field.

Note

If you choose the value ‘No’ in the ‘Allow units’ field, info from the next two fields will be not displayed on the front-end.

Note

When you update the "Price per" divider configuration, make sure you clear the cache (Specially Blocks HTML Output) to reflect the updated divider on the front-end.

Setting units and quantities for a single product

PRODUCT > CATALOG > PRODUCT UNITS AND QUANTITIES

Note

Click the product to start setting custom units and quantities for it.

Note

You can configure the settings of the Product Units and Quantities extension for each product individually.

Note

Set custom unities and quantities for a single product. Or use config settings previously specified in the General Settings tab.

Product Units and Quantities on the front end

Note

Shoppers select the product’s QTY before adding the item to the cart. The QTY input option set by the admin is used.

Front-end view: catalog

Note

Under each product, there is the price per particular amount of items.

Front-end view: shopping cart

Note

Customers can change products’ Qty in the cart by using available QTY input options.

Front-end view: wish list

Import & Export functionality

Import

You can assign units and quantities to the product using Magento's import functionality. Here are all the attributes that will be used to update units and quantities to any product.

Attributes Values Notes
sku product sku This is mandatory field and a valid product sku needs to be mentioned
replace_qty value range [0,1,2,3,4] 0 => off, 1 => Dropdown, 2 => Slider, 3 => Plus Minus, 4 => Arrows
use_quantities Need to provide integer value with spaces. For ex: 5 10 15 20 25 Default values = 1 2 3 4
price_per any string value Default value = "item"
price_per_divider any string value Default value = "per"
allow_units 0 or 1 0 => No, 1 => Yes
qty_type 0 or 1 0 => Static, 1 => dynamic
start_qty any numeric value Default value => 1. This is required only when qty_type => 1
qty_increment any numeric value Default value => 1. This is required only when qty_type => 1
end_qty any numeric value Default value => 100. This is required only when qty_type => 1
use_config_replace_qty 0 or 1. Default value = 0 0 => Consider values which are configured on product level, 1 => Consider values which are configured in admin module configuration
use_config_qty_type 0 or 1. Default value = 0 0 => Consider values which are configured on product level, 1 => Consider values which are configured in admin module configuration
use_config_use_quantities 0 or 1. Default value = 0 0 => Consider values which are configured on product level, 1 => Consider values which are configured in admin module configuration
use_config_start_qty 0 or 1. Default value = 0 0 => Consider values which are configured on product level, 1 => Consider values which are configured in admin module configuration
use_config_qty_increment 0 or 1. Default value = 0 0 => Consider values which are configured on product level, 1 => Consider values which are configured in admin module configuration
use_config_end_qty 0 or 1. Default value = 0 0 => Consider values which are configured on product level, 1 => Consider values which are configured in admin module configuration
use_config_allow_units 0 or 1. Default value = 0 0 => Consider values which are configured on product level, 1 => Consider values which are configured in admin module configuration
use_config_price_per 0 or 1. Default value = 0 0 => Consider values which are configured on product level, 1 => Consider values which are configured in admin module configuration
use_config_price_per_divider 0 or 1. Default value = 0 0 => Consider values which are configured on product level, 1 => Consider values which are configured in admin module configuration
use_config_is_qty_decimal 0 or 1. Default value = 0 0 => Consider values which are configured on product level, 1 => Consider values which are configured in admin module configuration
is_qty_decimal 0 or 1. This is mandatory field. 0 => No, 1 => Yes
store_id numeric value This is mandatory field. Please mention valid store id

Using the above attribute fields, you can prepare an import CSV file and import it to update products.

You can check Sample CSV File and use it for your reference.

How to import CSV file

You can use default Magento's import functionality to import the prepared CSV file. You need to go to Admin > System > Data Transfer > Import. Here, select "Product Unit Quantities Import" for Entity Type Dropdown.

The upload the prepared CSV file and import data. You can use Magento's guide to know details about all other fields and how to run the import.

Export

The configured and assigned values of units and quantities for any product can also be checked in exported product data. You can use the default Magento's export functionality to export the product and in the exported CSV, you can check the values.

Note

The same exported CSV file can't be used to update and import units and quantities configuration values for any product. For importing products with units and quantities configuration values, you will need to use a separate CSV as mentioned above.

You can use default Magento's guide to know how to export the product CSV.

THANK YOU FOR CHOOSING AITOC EXTENSIONS!