Problem: If customer jumps to my-store.com/checkout they can bypass cart limits?

Situation: Our store offers 3 samples of the customer’s choice with every order.

I was looking at either creating a code-based solution to limit the number of free samples the customer could add to the cart, or possibly using an app. In the process of doing my research, I noticed comments in some posts about customers being able to bypass checkout limits. So I decided to give it a try on my site and it seems that it is possible to bypass limits by jumping directly to the cart.

I’m currently testing the app Order Limits (MinMaxify). Limit of 3 samples per order with a cart minimum of $1.

You add samples to the order in the cart or you can also add from the samples page. If you add samples from inside the cart, you will get a warning message, but you can clear the message and keep adding samples. Once you added as many as you want, you can jump to https://test-store-colleen.myshopify.com/cart and complete the checkout process completely bypassing the cart limits.

That’s a significant issue for our site as we offer free shipping. So a customer could potentially add all of our samples into the cart and then jump to the cart and checkout getting 5-8 fragrance samples or more for free.

Is there a way to add a check & balance to the checkout page to prevent this?

site: https://test-store-colleen.myshopify.com/

password: thanksforyourhelp

Hello @colleenc ,

A clean custom solution for this situation:

  1. Remove quantity selector for these sample products when they are in the cart page.
  2. Before clicking on ‘atc’ check if this product is already in cart. If yes, show warning and prevent customers from adding it to cart. Or simply on load of product page check if this product is already in cart then hide the 'atc; button and display your custom message.

Thanks

1 Like

@Guleria Thank you for your quick reply.

I have already removed the quantity selector from the cart page, that was my first move :slightly_smiling_face:

I like the idea of preventing the add-to-cart if the product is already in the cart, but I have no idea what that code would look like. Is it possible to check to see if three items from a specific collection had already been added to cart and deny the add to cart on that basis?

In my case, the customer gets to choose 3 items from the sample collection. I would like to deny the add to cart after three items have already been selected and then display a warning message, but haven’t been able to find code samples to add to my site and test.

Fetch cart loop on sample collection product single page.
For more check cart object and check cart loop in cart template. You have to implement the same logic as you applied in the cart page to hide the quantity selector of the product that belongs to the collection sample.

1 Like

If your are on Shopify Plus give the samples a cost then use checkout-scripts to discount the allowed quantity to be free during checkout.

If not on Shopify Plus you need to implement a bookend of solutions.

Apps for purchase limits only provide a quick frontend bandaid the cart , and then even once you do more customization to other areas of the storefront there is still the edge case of imporoper cart creating by anyone savvy enough to use the ajax api.

Thus you then also need something on the backend to validate orders for editing, or cancelation.

Some other approaches are

  • using a custom draft orders system
  • using discount codes so “free” samples are only free per conditions you set(1 discount per customer)
  • having 1 product that represents all samples and gathering the scents as line item properties
  • not having free samples as products but simply as a cart note/attributes(see gift-wrapping customization tutorial)
  • let a sample “product” be added to the cart, but only actually add them to the cart when they select the scents on the cart page after the checkout button is clicked).
  • Charging for the samples in exchange for a credit/discount on future purchases https://tasks.mechanic.dev/credit-customers-for-sample-orders
  • Shipping weight denial: make samples have a heavy weight in combination with shipping rules that do not apply to that overweight. i.e. 10lb each x 30lb , but x4 = 40lb
  • Use the carrier service api to reject orders in /checkout by not having any shipping options.

For custom draft order process, or order validation logic usemechanic can be script to most businesss rules

https://tasks.mechanic.dev/create-a-draft-order-from-the-cart

https://tasks.mechanic.dev/auto-cancel-orders-with-too-many-of-a-certain-sku