> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://molsoft.crisp.help/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Add to Cart Blocking

MinCart checks your limits in the cart and at checkout. With **Add-to-cart blocking**, it also checks them on your product pages, before anything is added to the cart, so customers learn about a limit before they reach the cart.

## Table of Contents

1. [What's checked at add to cart](#2-whats-checked-at-add-to-cart)
2. [Buy it now and express checkout buttons](#2-buy-it-now-and-express-checkout-buttons)
3. [Turn it on](#2-turn-it-on)
4. [The message block](#2-the-message-block)
5. [When the quantity is outside the limits](#2-when-the-quantity-is-outside-the-limits)
6. [Things to know](#2-things-to-know)
7. [Troubleshooting](#2-troubleshooting)
---

## What's checked at add to cart

When a customer clicks **Add to cart**, MinCart checks the cart as it would be after the add: what's already in the cart, plus the quantity they chose. It checks:

* **Every maximum**, of every limit type.
* **The minimum and the multiple of Variant limits.**

Minimums and multiples of the other limit types (Whole Cart, Product, Collection, Product Type, Vendor, Tag) can be met by combining products or variants, so they aren't checked at add to cart. MinCart still checks them in the cart and at checkout.

| Example: a Product limit has a maximum of 10. A customer with 8 in the cart selects 3 and clicks Add to cart: nothing is added, and the limit's message explains why. With 2 selected, the add goes through.
---

## Buy it now and express checkout buttons

**Buy it now** and the express checkout buttons in product forms (Shop Pay, Apple Pay, Google Pay, PayPal, "More payment options") skip the cart: their checkout holds only the product on the page. So MinCart checks them on their own, against a cart holding just that product, and every limit counts there, minimums and multiples included.

| Example: a Whole Cart minimum of $100. On a $40 product, Add to cart works (the customer can keep shopping), but Buy it now is blocked: that checkout would hold $40.

Each button follows its own check: Buy it now can be blocked while Add to cart isn't, and the other way round.

If you'd rather not offer Buy it now at all, you can turn dynamic checkout buttons off instead: see [Unsupported Dynamic Checkout Buttons](https://molsoft.crisp.help/en/article/unsupported-dynamic-checkout-buttons-166qq1e/).
---

## Turn it on

1. In your Shopify admin, go to **Online Store** > **Themes** and click **Customize**.
2. Click **App embeds** and select **MinCart Main Script**. It must be turned on.
3. Under **Add-to-cart limits**, check **Add-to-cart blocking**.
4. Click **Save**.

| The setting is saved with the theme. When you publish another theme, check it there too.

| To try it before your customers see it, turn it on in a copy of your theme and use **Preview**.
---

## The message block

The **MinCart limit messages** block shows the limits' messages on the product page, where you place it, and updates as the customer changes the quantity or the variant.

**With the block**, when an add would break a limit, the add to cart button is disabled and the block shows every limit message that applies.

**Without the block**, your product page keeps its normal look. A click on Add to cart or Buy it now that would break a limit triggers MinCart's popup that shows the limits messages and prevents the add to cart.

### Add the block

* On MinCart's **Home** page, click **Add to product page** (in the setup guide, or on the Message block row of the App extensions box). The theme editor opens on your product template with the block added. Move it near the add to cart button, then click **Save**.
* Or in the theme editor: open your product template, click **Add block** in the product information section, choose **MinCart limit messages** under **Apps**, then click **Save**.

The block only works when the **MinCart Main Script** app embed is on, with **Add-to-cart blocking** checked.

### Block settings

* **Style**: Tinted box, Outlined box, Accent bar or Text only.
* **Corners**: Match the add to cart button, Square or Rounded.
* **Text size**: Small, or the same as the text around it.
* **Show an icon**.
* **Colors**: text, background, border and icon. Leave a color empty to use your theme's: the block then follows the color scheme of each section it appears in.

The messages are your limits' own texts, in every language you've set up. There's nothing new to translate.
---

## When the quantity is outside the limits

Two settings under **Add-to-cart limits** in the app embed choose what happens.

**When the quantity is outside the limits**

* **Block and explain** (default): add to cart is blocked while the quantity is outside the limits, and the limit's message explains why. The quantity selector is unaffected.
* **Correct the quantity and explain**: a quantity outside the limits is changed to the closest allowed one, and the limit's message explains the change. This also happens when the page loads and when the customer picks another variant: a variant with a minimum of 3 starts at 3 when the cart has none of it.

**Variants sold in multiples** (Variant limits with a "multiple of" configuration)

* **Block and explain** (default): add to cart is blocked until the variant's total is a multiple, and the limit's message explains why. The quantity selector is unaffected.
* **Force the quantity selector to stay in steps**: the quantity selector only offers quantities that bring the variant's total to a multiple, counting what's already in the cart. With a multiple of 6 and 4 already in the cart, it offers 2, 8, 14, and so on. A typed quantity is changed to the closest one.

A correction's message shows in the message block. Without this app block, nothing is shown when the quantity is corrected, and the popup explains the limit if the customer clicks Add to cart with a quantity outside the limits.
---

## Things to know

* **Quick add, quick views and featured products** are checked too. Where they don't show the block, the popup explains the limit.
* **PayPal**: PayPal's button runs inside PayPal's own frame. With the message block, MinCart turns the express checkout buttons off while Buy it now is blocked, PayPal's included. Without the block, MinCart can't stop a click on PayPal, and checkout validation doesn't stop that checkout either, since it doesn't come from the customer's cart. Only the checkout extension (Shopify Plus) checks it at checkout. If your store shows PayPal on product pages, add the block or disable the dynamic checkout buttons in your theme settings.
* **Buttons outside product forms**: a sticky add to cart bar, or another button that adds with JavaScript outside the product form, isn't checked at add to cart. Since MinCart cannot intercept the click of those custom buttons, MinCart only block the user at the cart level after the add to cart.
* **Themes that hide empty blocks**: some themes hide any block while it's empty, so the message block can't appear. MinCart then uses the popup on those pages.
---

## Troubleshooting

**An add to cart button isn't checked.** MinCart finds most add to cart buttons by itself. If one isn't detected (a button from a product options app or a page builder, for example), enter its CSS selector in **Custom add to cart selector**, under **Add-to-cart limits** in the app embed. Type it without quotes: `.add-to-cart-button`, not `'.add-to-cart-button'`. [Unsupported checkout button](https://molsoft.crisp.help/en/article/unsupported-checkout-button-38hsfs/) shows how to find a selector, or contact our support and we'll find it for you.

**Nothing happens at add to cart.** Check that, in the theme you're looking at, the **MinCart Main Script** app embed is on and **Add-to-cart blocking** is checked, and that the limit is Live.