Hi all,
I am building a webshop and I would like to be able to change the quantity of products or remove them from my gallery.
I can think of two options:
Currently the dropdown is configured like this:
Sequence(ThisItem.Amount+3,0,1)
In my gallery the items ar grouped
AddColumns(
GroupBy(
basket,
"itemname",
"itemopt",
"itemprice",
"itemname_rec"
),
/* "Total", Sum(itemname_rec, itemprice), */
"Amount",
Sum(
itemname_rec,
itemcount
)
)
I am really stuck here and any help is appreciated!
Solved! Go to Solution.
Hi @RandyHayes
this is the error:
And at the button it says "Name isn't valid. idetifier isn't recognized"
Yes, you have a syntax error in that formula. The error mentions what it is...there is an issue with the closing parens and curly brackets.
It looks like you took the formula I provided earlier and removed the dd_amount.Selected from the formula and failed to remove one of the closing parens to the Value function that was removed.
Should be:
With({_itm: LookUp(basket, itemname = Gallery4.Selected.Title)},
If(!IsBlank(_itm.itemcount),
UpdateIf(basket, itemname=_itm.itemname,
{itemcount: _itm.itemcount + 1}
),
Collect(basket,
{itemname: Gallery4.Selected.Title,
itemcat: Gallery4.Selected.Category,
itemprice: Gallery4.Selected.Price,
itemopt: dd_options_5.Selected.Result,
itemid:Gallery4.Selected.ID,
itemcount: 1
}
)
)
)
Are you no longer considering the dropdown for incrementing the count?
Hi @RandyHayes
thanks a lot...now it works, seems, I made a mistake...sorry for that!!
But the Keyboard layout options should be considered aswell, so keyboard layout GER should not be grouped with IT for example, because they have different prices.
Yes, I want to get rid of the dropdown. But I am free if you think, that this is better/easier to implement I go with that as well.
No, I didn't like the dropdown concept from the beginning. For carts, either provide an increment/decrement option, or just a plain textinput to input a new quantity.
Think about the user experience - If I added an item to the cart and wanted 100 of them, I'd have to click on the + icon 100 times to get what I want...very annoying. And a dropdown limits my choices, because, if it only went up to 50 and I wanted 100, how would I get that?
As for the grouping...this is going to be based on how you look to see if the collection already has an item in it.
Right now we have this:
With({_itm: LookUp(basket, itemname = Gallery4.Selected.Title)},
...
So, you are ONLY basing the addition of the item to the cart on the itemname.
If you want to expand that to other parameters, then add then to the LookUp.
Ex:
With({_itm: LookUp(basket, itemname = Gallery4.Selected.Title &&
itemcat: Gallery4.Selected.Category &&
itemopt: dd_options_5.Selected.Result)},
...
Would base it on the itemname, itemcat and itemopt.
Hi @RandyHayes
I fixed it and it works great!
The only thing that is left now (for today 😊) is how to use the arrows in the shopping tray.
OnSelect: ThisItem.itemcount +1
does not work...!
Hi @RandyHayes
this webshop is only for our internal user, where you maybe order anoth.er headset or a noew lapttop with docking for a new employee or maybe 4 or 5 keyboards or mouse. So, I think a +/- would be good to have to quickly change the amount in the tray.
How would I do the formula to increment with the arrow up (or later +)--> because I cannot find the minus symbol?
Yes, that incrementing will not work. Here is what you need.
On the Plus icon:
With({_itm: LookUp(basket, itemname = Gallery4.Selected.Title &&
itemcat = Gallery4.Selected.Category &&
itemopt = dd_options_5.Selected.Result)},
Patch(basket, _itm, {itemcount: _itm.itemcount + 1})
)
And for the minus:
With({_itm: LookUp(basket, itemname = Gallery4.Selected.Title &&
itemcat = Gallery4.Selected.Category &&
itemopt = dd_options_5.Selected.Result)},
Patch(basket, _itm, {itemcount: _itm.itemcount - 1})
)
I would also put this on the minus button.
If(LookUp(basket, itemname = Gallery4.Selected.Title &&
itemcat = Gallery4.Selected.Category &&
itemopt = dd_options_5.Selected.Result,
itemcount) <=1,
Disabled,
Edit
)
This will keep people from going less than 1 on the item.
I would assume then a Delete icon on the item so people can get rid of it:
RemoveIf(basket, itemname = Gallery4.Selected.Title &&
itemcat = Gallery4.Selected.Category &&
itemopt = dd_options_5.Selected.Result
)
Hi @RandyHayes ,
I just checked more closely and I found an issue.
When adding black iPhones from the "Add to cart" button, the number of white iPhones is increased aswell.
For products without the itemoption (itemopt= dd_options_5.Selected.Result) ist working correct.
So, for example:
results in 4 black and 4 white phones.
Somehow it seems that the option is not found correctly. I can not find the logical error in the formula.
Do you have an idea?
User | Count |
---|---|
257 | |
127 | |
104 | |
49 | |
49 |