Shopify extension equivalent of script change_line_price message parameter

We currently have this line item script:

Input.cart.line_items.each do |line_item|
   price = line_item.variant.price *.5
   puts price.inspect
   p_new_price = price * line_item.quantity
   price_message="SPECIAL PRICING: RETAIL KICKEE PANTS EMPLOYEE"
   line_item.change_line_price(p_new_price, message: price_message)
end

This results in something like this (different discount amount but you get the idea):

However, I can’t find how to do the message part in a Shopify extension function. The most I’ve been able to come up with is altering the line item title:

Is this not possible with a function?

It is possible with discount function. From what I see you are using line item cartTransform Had you ever try Product Discount Function.

https://shopify.dev/docs/apps/selling-strategies/discounts/experience/getting-started

1 Like

Great idea! Thank you.