Hi,

This is a newbie question, and I would appreciate any suggestions as to
how I can correctly implement this within cake.

I have a simplistic shopping cart - and products can be added to the
cart from either the product listing page (index) or the product detail
(view). The 'cart' itself is an element that will be included in both
the index and the view thtmls.

What I need to do is keep the user on the same page even after adding
product(s) to the cart i.e. the user views the product listing, clicks
the 'add to cart' button for one of the products, and the same page
refreshes with the updated cart.

The issue I'm running into is that the action ('addtocart') in the
controller is obviously looking for a view with the same name, which
doesn't exist. One way I could possibly hack it is to set a hidden
field with the url and then redirect back to it at the end of the
action. But there has to be a better way...

Any ideas/suggestions?

Thanks!
Chandan
ps: Ideally I would like to use ajax to update the cart so that the
whole page doesn't have to refresh, but I'm just taking it one step at
a time.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to