Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any way to reduce quantity of a producto without removing it? #1

Closed
rusosnith opened this issue Oct 24, 2019 · 3 comments
Closed

Any way to reduce quantity of a producto without removing it? #1

rusosnith opened this issue Oct 24, 2019 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@rusosnith
Copy link

Adding negative quantity does not work

@peet86
Copy link
Owner

peet86 commented Oct 30, 2019

Atm you can do it like this:

update(id,'quantity', get(id).quantity - 1) 

But I agree, there should be increase / decrease methods.
I will implement them and extend the library.

@peet86 peet86 added the enhancement New feature or request label Oct 30, 2019
@peet86 peet86 self-assigned this Oct 30, 2019
@peet86
Copy link
Owner

peet86 commented Nov 10, 2019

@rusosnith I've added a new method called "quantity". One can use this to increase/decrease the quantity value without querying the current value of the product (like in my example above).

You can use it like this:

quantity(id,1)
quantity(id,-1)

@peet86 peet86 closed this as completed Nov 10, 2019
@rusosnith
Copy link
Author

that is awesome indeed! thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants