I’m creating a header for my store. Within that header i want a heart icon and a cart icon (easy and completed). The area I’m having issues is creating a number within boht icons respectively that correlates with a user’s behavior of adding favorites and adding things to cart. A picture is attached for visual reference.
Do you mean you are having an issue placing the text inside of the icon? If yes, then you could use the “align to parent” group and place the number directly over the icon.
Yeh! like conceptually i knew what it had to be, but i wasn’t sure how people did it bc when i tried to just paste a textbox over it and put some conditions around it, the textbox wouldn’t go over… i thought maybe there’s another icon somewhere that has the number functionality in it? i didnt know. anyway so you just put a textbox over the top? I’m super new to Bubble btw for context, I’ve only been using it one week hence the really green questions. thanks
You just put an Icon and a Text element inside a group and set it to Align to Parent layout so they can stack on top of each other (with the text on top). Then the number would be the count of the cart items, for example Current user's Cart items:count
or if you have some other datastructure it could be Do a search for Cart Items (constraint User = Current User) :count
would be most performant to store the “current cart” on the current user
then do current users > current cart > cart item > count
storing cart items on the cart is preferred also so that you’re not constantly doing searches to fetch it
Thanks! i just poked around and I looked in workflows and also in the conditional tab. Do you mind sharing where I put these commands? And do I set the commands for the text number starting it at zero and then do a condition of “dont show” if the number is zero? Sorry so new to this. thank you so much