• Home
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Create an article
  • Post an idea
  • Spaces
  • App Market Developer Platform
  • Clover GO
  • Ideas & Feedback
  • Semi-Integration
  • Explore
  • Topics
  • Questions
  • Articles
  • Ideas
Skip to main content
  • Create
    • Ask a question
    • Post an idea
    • App Market Developer Platform
    • Clover GO
    • Ideas & Feedback
    • Semi-Integration
    • Topics
    • Questions
    • Articles
    • Ideas
  • Sign in
  • Home
  • App Market Developer Platform
This question was closed Apr 02 at 09:46 PM by Clover_Community_Bot for the following reason: automated

question

Mateus avatar image
Mateus asked · Jun 06, 2017 at 02:35 PM

Can I change the name of a variable price line item?

I'm using a variable price inventory item to add a tax that can't be implemented via Tax Rates. As the user adds liquors to an order, I add those variable price items(one for each liquor). Let's say the name of this item is "Tax XYZ". I'd like to have something like this, though, on the register/receipts:
Tax XYZ (750mL) 1.86
Tax XYZ (250mL) 0.92

In other words, custom names for different line items backed by the same variable price inventory item. Is it possible? My current solution is to use binName.
OrdersInventoryLineItems
Comment
0
10 |2000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Toggle Comment visibility. Current Visibility: Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Miguel avatar image
Miguel answered · Jun 06, 2017 at 09:50 PM ACCEPTED ANSWER Locked
Hi @Mateus
I just tried the following in our Android SDK, and it seems to do what you're looking for:
Item item = mInventoryConnector.getItem("TZ8EERTEG74XR");
item.setName("Name A");
mInventoryConnector.updateItem(item);
mOrderConnector.addVariablePriceLineItem(order.getId(), item.getId(), 100, null, null);
item.setName("Name B");
mInventoryConnector.updateItem(item);
mOrderConnector.addVariablePriceLineItem(order.getId(), item.getId(), 200, null, null);
item.setName("Original Name");
mInventoryConnector.updateItem(item);
The only caveat I found was that if the price was the same, the items were grouped by together. In my example above, if the second item was priced at 100, it would list two "Name A" at $1 on the order.
· 4 comments · Share
10 |2000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Toggle Comment visibility. Current Visibility: Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Mateus avatar image Mateus · Jun 07, 2017 at 05:41 PM

Another caveat is that this will permanently change the name of the item in the inventory. I was hoping to change the line item name only. Thanks for your help!

0 · ·
Miguel avatar image Miguel Mateus · Jun 07, 2017 at 05:48 PM

You could set the name back to the original at the end.

1 · ·
Dan avatar image Dan ♦ · Jun 07, 2017 at 08:12 PM

I'm not sure this is what you actually want to do. If two devices are both modifying the same item to apply the temporary name, results will be unpredictable. This also mutates the item twice in addition to adding the line item.

It sounds like what you are trying to do is apply a flat tax to the order for each volume of liquor sold. The closest I can think of is adding a custom item with a specific name each time a bottle is added to the order, but I don't know if that is a good idea/meets your requirements.

1 · ·
Mateus avatar image Mateus Dan ♦ · Jun 09, 2017 at 08:54 PM

Thanks for the warning, very true.

I can't use custom items, as I need the line items to be backed by inventory items.

0 · ·

Welcome to the
Clover Developer Community

question details

3 People are following this question.

mateus follows this question miguel follows this question dan follows this question
Answers Subscribe to Answers Answers and Comments Subscribe to Comments and Answers

Related Questions

Getting Product SKU through API 1 Answer

Is there a way to retrieve a single item category per order line with REST V3 api? 2 Answers

need to call Create a new line item clover api for each quantity even if same Item is placed with 2 or more quantities 1 Answer

Not able to listen events from OrderV3Connector.OnOrderUpdateListener2 0 Answers

Attach labels to order for automatic printing 2 Answers

Answerhub Logo
  • About
  • ·
  • FAQ
  • ·
  • Privacy
  • ·
  • Copyright © 2010-19 DZone, Inc.