Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8927127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:08:53+00:00 2026-06-15T08:08:53+00:00

I am using cart attributes to add extra information for each product to the

  • 0

I am using cart attributes to add extra information for each product to the cart (from the product page). I am specifically using cart attributes over line item properties because the client needs to be able to edit this information in the order later on which line item properties don’t allow.

Adding the information works just fine, the problem comes in when a customer decides to remove an item from the cart because although the item is removed, the cart attribute remains since it is not specifically tied to the product (other than a naming convention that we give it.)

So, is there a way to update/remove specific cart attributes?

Thanks in advance for your replies!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T08:08:54+00:00Added an answer on June 15, 2026 at 8:08 am

    I have used cart attributes since they were introduced, and found most of the bugs associated with them along the way (which Shopify fixed along the way), giving me enough confidence to inform you on this question.

    To edit them, simply provide the cart with the same key you used to create them, and change the information. If you provide an empty value, you’ll remove the key. It is just a key:value store. As are line items, which by the way, are editable in my book. I managed to edit them by simply changing the value of the key, and by providing the line item index value, something maybe you overlooked?

    Anyway, if you take the provided Shopify Javascript API code, and examine that small library, you’ll see the functions used to create attributes. With a little minor change, you can introduce your own cart attribute CRUD functionality to suit your needs.

    Here is an old example showing off updating the cart attributes, data is a string ie) “attributes[fizz]=’buzz’ (and note that you can thus store JSON):

    updateCartAttributes: function(data, callback) {
      var params = {
        type: 'POST',
        url: '/cart/update.js',
        data: data,
        dataType: 'json',
        success: function(cart) {
          if ((typeof callback) === 'function') {
            callback(cart);
          }
          else {
            Shopify.api.onCartUpdate(cart);
          }
        },
        error: function(XMLHttpRequest, textStatus) {
          Shopify.api.onError(XMLHttpRequest, textStatus);
        }
      }; 
      $.ajax(params);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using jQuery ColorBox to display a shopping cart item. When a user enters
I have 25 products showing in a page. Each product contains a form within
I have this tag in example: <button onclick=setLocation('http://mysite.com/checkout/cart/add/product/17/') /> What I need to do
I'm using a shopping cart script from a tutorial I came across a while
I need to know how can I add products into cart using API. I
I have product panels on a cart-view page where the user can click an
I am adding items to a cart using URL ?action=add . I have not
I'm currently building an e-commerce site in wordpress using the WP-ecommerce plugin.In product page,
I am using interspire shopping cart version 3.5 when uploading product image following error
I'm currently using WP Shopping Cart . Per order of a product, I need

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.