Can I delete a line-item property with update.js

Can I delete a line-item property with update.js

shahrukhAhmed
Shopify Partner
30 0 4

I have a situation where I want to get rid of some of the properties I set when a certain condition is met. How do I achieve it with update.js? I have tried 

          properties: {
            _id: "",
          }

          properties: {
            _id: false,
          }

but, nothing has worked. 

Replies 2 (2)

juansmartdev
Shopify Partner
85 17 24

Hi, @shahrukhAhmed 

You can only set them to false or null from the cart API 

◦ Problem Solved? ✔️ Please click on Accept as Solution and like.
◦ Hire me! Senior Shopify Developer.
◦ Contact me at: juandev.martinez@gmail.com
motiv
Shopify Partner
17 0 7

Any chance you can show an example? I'm trying to make it that if product X was removed from cart and product Y is in the cart, then remove product Y as well.