I cannot change dynamically the quantity +/- of each product added in the basket

Hello everyone

PLEASE I NEED HELP


THANKS

I believe you are adding +/- in each product. In such case why do use very complex block to inc or dec quantity.

Imagine the qty is printed on the dynamic lable with id qty{number}

Also imagine this + and - sign created in lable with click enabled with id plus{number} and minus{number}

When any lable clicked.
Get id of the clicked component 
If the id contains the text minus
Sel lable text with id qty{numner} to get text of qty -1
Else if it contains the text plus
Set lable text with qty{number} to get text of qty{number} + 1

Hi @Still-learning

Here is what I tried to assemble but it does not work.

I changed my pimples +/- Label images with Material Icons.

In both case you are using old value + 0, if so how will it increment or decrease.

If it is + label, and if the text is greater than  equal to 0 
then old value + 1 
//no need of else
If it is - label and if the text is greater than 0 
Then old value - 1 
else alert you cannot set qty in minus

.

You can guide me with visual blocks please

Sorry my pc is under an issue. Unable to generate blocks, mobile version blocks are somewhat blurring.

1 Like

No, don’t excuse yourself.
However, I find it difficult to target the right ID of the corresponding textbox component


You are pressing the +/- label id but converting into text box id?

So do you created comp like this?
HA{id}
In this +{id} & tbox{id} & -{id}?

In such case the logic is different? Have you seen my suggestion? I have used label id into print lable id.

On pressing + or / lable component

Get id of the component, convert into tbox id

From this tbox id get the tbox value and this will behave as a oldValue. Then print this value into the textbox according to the above logic

Your error says that tboxID is not proper. Pls see to that

Yes you are right, it’s exactly it’s that I did.

Yes I saw your suggestion in a 1st step I thought it was an error because I use a textbox to also allow the User to modify/enter the quantity with the keyboard. And in 2nd time, until I could not know which component ID assigned to him?

I still haven’t understood your suggestion? at least oubien how should I implement it in my case.

Help me please with the assembly of the blocks

Hi @Still-learning

After doing my research here is another other solution that I don’t sure how to implement

Send us your sample aia

dyna.aia (40.7 KB)

better test this aia


1 Like

GreenVa_Store.aia (2.3 MB)

Hello, i was shock to see that the + and - are not dynamic components.


i got false in label23 on clicking this + and -
My logic will works only with dync comp

:joy: :joy: Sorry Master.

Here, on this page of the “Detail Product”, I preferred to put static components .. while I had the problem here on the forum how to activate the static button to add the product to the Cart (Panier) via the shema if you remember

The problem had exceeded me. I only fled this part of the application. Otherwise, concerning the +/- static buttons I succeeded.

Here is my process to add an article to the basket :

When the user clicks here, it allows him to select and add the article to the basket

This is where I am blocked with the +/- dynamic buttons.


when this will get trigger?

test this @Abdoulaye_OUBALE

GreenVa_Store (1).aia (2.3 MB)

It is a Toggle button that allows you to trigger the dynamic creation of the Cart in the basket by changing red/green color.
When it’s green: the product is added in the basket
And when it’s red: the product is removed from the basket.

The concern is here what when you click several by selecting and deselecting the same product. This error is displayed. Because he fails to release the old IDs from the components already created to generate new dynamic components.


The bug comes from this part of the code, after the deletion :

I tried to correct the error with the block :
component_method

It works perfectly well :partying_face:

MERCI :folded_hands: