Transform repeater items between pages

advanced-prototyping

#1

I’m building a shopping cart in axure. The shopping cart is a repeater with items. When I add a product (from a different repeater), i add an item to the shopping cart repeater. This works great.

  1. Problem is that I have multiple pages. Each time I go to a new page the shoppingcart is empty. Is there a way to save the contents of a repeater between multiple pages?

  2. Is it possible to check if a product is already in the basket? In that case, I don’t want to add another item, but update the number of items of the product.


Transferring objects inside a repeater between screens
#2

Unfortunately, there is no way for repeaters to persist between pages. The only way to do this is using dynamic panels.

With your second question, I’ve done this by setting a variable for QTY and incrementing it. So, if it’s > 0 then the product has already been added. This presents other problems though and I’ve just posted in here to see if I can answer those.


#3

Hi pieterh,

Andy J is right, you can’t have Repeater datasets persist across pages.

But what I would recommend is instead of actually adding/removing rows to a Repeater, you pre-fill the Repeater with all of your products and just filter out rows with a quantity of 0.

The result is that you are just updating each existing row to increment the “qty” column by 1.

Then you make a copy of this fully loaded Repeater on a new page and pass the quantities over using Global Variables and load those into the new Repeater OnPageLoad. Does that make sense?

For example, I have three items all with a quantity of “0”: “Item 1”, “Item 2”, and “Item 3”

While shopping, if I add “Item 1”, its quantity column is updated to “1”, and so on. Then the link to the “checkout” page sets three variables–“Item1tqy”, “Item2qty”, “Item3try”–to their respective quantities before linking. These values are conserved and then loaded into an exact copy of the Repeater.

I’ve made a crude demo file demonstrating this for you to check out. Is this close to what you are aiming for?

Let me know if you have any questions!
ShoppingCart.rp (78.7 KB)


#4

Thanks for your feedback.

Unfortunately I’ve got around 100 products in the shop, so add all items to the basket with itemXqty variables is a little bit too much work for me.


#5

Man, it`s just a prototype. Are you making full-working shop in Axure or just making mosh-up?


closed #6

unlisted #7