Welcome Guest, Not a member yet? Register   Sign In
shopping cart url
#1

[eluser]Unknown[/eluser]
Hi.
I've got a web site based on ci with a shopping cart.
the url for adding a product is example.com/cart/add/[product id]
but i don't want that users will refresh accidentally and it will create problems , or maybe will click back and forward on browser, and try to add the product again.

What should i do? can i make a a redirect on view? use ajax?
please suggest.

Thanks.
#2

[eluser]Zeeshan Rasool[/eluser]
well i think redirect can be good soultion for this, but why not you use ajax for inserting record this can be looking best for users.
#3

[eluser]Thorpe Obazee[/eluser]
[quote author="Colene Stacey" date="1245903025"]Try looking in poor neighborhoods. Seriously, if anyone is likely to steal a cart, its the poor. Maybe somebody already did the work for you and all you'd need to do is put it in your car and go.What you can also try is looking in family-run supermarkets. These tend to be ethnic supermarkets. If you see a cart outside, they're generally unmarked and have no security system. Now, I'm not condoning stealing, but if you really wanted to, you could take one from there. If you want to be honest about it, ask the store owner where they bought their carts.[/quote]

Why assume that it's the poor that stole it? Tongue
#4

[eluser]nZac[/eluser]
[quote author="tzvika" date="1240745844"]Hi.
I've got a web site based on ci with a shopping cart.
the url for adding a product is example.com/cart/add/[product id]
but i don't want that users will refresh accidentally and it will create problems , or maybe will click back and forward on browser, and try to add the product again.

What should i do? can i make a a redirect on view? use ajax?
please suggest.

Thanks.[/quote]

AJAX would be a good way to do it. If you don't what to use AJAX you could check to see if the user has added that product before and if they have, have a confirmation box ask them if they want to add it again.

Personally I would chose AJAX basically because you would not have to refresh, and it does not have a pop-up. Up to you!
#5

[eluser]Zeeshan Rasool[/eluser]
well, would you like to use jquery cart implementation. I think its also a best way to do this.




Theme © iAndrew 2016 - Forum software by © MyBB