• Skip to primary navigation
  • Skip to main content
  • Skip to footer

Merchant Labs

Helping online merchants succeed is what we do best!

  • About
  • Contact
  • My Account

Experiments, JavaScript, Liquid, Proof of Concept, Shopify, Useful Code / November 14, 2017

Shopify – The Best Method to Remove Multiple Products At Once

In a recent project I was working on, I had the need to remove multiple products from the basket at once. At first glance I thought this would be trivial, but quickly found it to be rather problematic.

Ultimately the method that worked out best for me was to construct the following request via a jQuery.post() call.

jQuery.post('/cart/update.js', {updates: {794864053: 0, 794864233: 0}});

The number is the variant ID for the product in the cart that you want to remove. The reason this method is the best is that every other method I found only allowed for the removal of one item at a time from the basket.

I would have to do some testing, but it could be possible to create a form that generates this request so it can be submitted via straight HTML.

Filed Under: Experiments, JavaScript, Liquid, Proof of Concept, Shopify, Useful Code Tagged With: Coding, Javascript, Shopify Liquid

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Footer

Shopify Partner

Let Merchant Labs, with over 15 years experience in ecommerce, help you SUCCEED online! From …

Read More about Shopify Development Services

  • Twitter
  • YouTube

Ajax-Cart Coming Soon

What is Ajax-cart for Shopify? Ajax-cart for Shopify is a big project to bring some of the most wanted features to the Shopify cart page. This page is also known as the basket screen. Its …

more about Ajax-Cart for Shopify

Tags

Apps Script Coding Documentation Javascript MySQL PHP Shopify Liquid

Contact Us

Merchant Labs
Los Angeles, California

P: 424-236-0372
E: [email protected]

Proud Partners For

Copyright © 2025 · Digital Pro on Genesis Framework · WordPress · Log in