How to keep custom line item classes from disappearing after updating cart quantity?

In cart-liquid-template I have changed the below line:

  • to:

  • By doing so the custom line items have specific class names. This works great when the page is first loaded however if I update the product qty in the cart the classes all get removed. I assume the line item is updated via ajax and results in custom code from not being added.

    Any ideas how to prevent this from happening?

  • i think you are looking for something like this tutorial line item property

    it displays content all the way through the cart and checkout process

    https://www.youtube.com/watch?v=ui_U6TJB2EI

    Thanks for the link but unfortunately it didn’t solve the issue.

    To better explain the issue I have added some custom classes and information to items in the cart. I used this specific tutorial:

    https://www.huratips.com/tech-tips/how-to-display-the-subscription-frequency-of-recharge-app-on-the-cart-page.html

    It works great when the cart page first loads however if I update the product qty in the cart the customisations vanish.

    I found a similar topic here but no solution:

    https://community.shopify.com/topic/1049389