Documentation
Feedback
Guides
VTEX IO Apps

VTEX IO Apps
Advanced components
Quantity On Cart
Official extension
Version: 2.2.8
Latest version: 2.2.8

{"base64":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABCAIAAAB2XpiaAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAFUlEQVR4nGPg4+Mz1Nfjl5T7f2c+AAzxA3lptuDWAAAAAElFTkSuQmCC","img":{"src":"https://img.shields.io/badge/all_contributors-0-orange.svg?style=flat-square","width":110,"height":20,"type":"svg"}}

The Quantity on Cart app allows you to display a message to your customers informing how many units of a product they have added to the cart. This message can be displayed in a Shelf or in a product page.

{"base64":"  ","img":{"width":1874,"height":856,"type":"gif","mime":"image/gif","wUnits":"px","hUnits":"px","length":4638002,"url":"https://user-images.githubusercontent.com/67270558/162291375-e469fb78-ef87-4eeb-bd8b-f228a4579a52.gif"}}

The Quantity On Cart app does not work with promotions scenarios such as Buy Together and Buy One Get One.

Configuration

  1. Open the terminal and use the VTEX IO CLI to log into the desired VTEX account.
  2. Run the following command to install the Quantity On Cart app:

_10
vtex install vtexarg.quantity-on-cart

  1. Open your store’s Store Theme app directory in your code editor.
  2. Open your app's manifest.json file and add the Quantity On Cart app under the peerDependencies field.

_10
"peerDependencies": {
_10
"vtexarg.quantity-on-cart": "2.x"
_10
}

  1. Add the quantity-on-cart block to other theme block using a product context since the quantity-on-cart block handles product data, such as the store.productor the product-summary.shelf. For the example below, we have added to the product-summary.shelf:

_10
{
_10
"product-summary.shelf": {
_10
"children": [
_10
+ "quantity-on-cart"
_10
]
_10
},
_10
...

After step 5, no further configuration is needed, and the app is ready to use in your store.

The displayed message in the Quantity On Cart app is available in three languages: English (EN), Spanish (ES), and Portuguese (PT), and follows the pattern below, which cannot be changed: EN - You have x units in your shopping cart. | ES - Tienes x unidades en el carrito. | PT - Você tem x unidades no carrinho.


Customization

To apply CSS customizations in this and other blocks, follow the instructions given in the recipe on Using CSS Handles for store customization.

CSS Handles
quantityOnCart
See also
VTEX App Store
VTEX IO Apps