dreamingmind / bindery

CakePHP 1.3 Based Dreaming Mind Bindery Site
2 stars 2 forks source link

Edit Cart Item feature #245

Closed dreamingmind closed 9 years ago

dreamingmind commented 9 years ago

see issue #244 updateQuantity()

The source url could be included in the source form (and stored in Supplement) to simplify navigation back to the edit page.

This could make the edit feature a method on the PurchaseProduct base class which would be simpler than requiring concrete versions. But it would increase the design requirements for the forms used in the purchase process.

dreamingmind commented 9 years ago

A bit of a snag. I placed the url for 'catalogs/pname/purchase' in an edit_path field in the Supplement array, pretty much as planned. It worked fine... then later, when I was implementing the actual editing feature, I found I needed to use a different catalogs method to render the pname/purchase page.

Since I now had the same form on a different url, the edit_path field now had a different value.

Since I hadn't yet implemented the actual editing of a record, the button on the form now created a new record from the same form and the edit_path in the Supplement record was an unexpected pattern. So these new items were not editable.

Possibly, all I need to do is hook up the true editing processes and prevent the creation of new items from what is intended to be an edit page.

dreamingmind commented 9 years ago

It's hard to keep in mind that cart item editing is not a fixed process built into the cart system.

There is no requirement that a kind of product allows editing beyond the qty change and removal available in the cart ui.

But if a kind of product does allow editing, the feature is coordinated set of tools, unique to that product type.

The pieces involved:

None of this is a fix or required part of the Cart system, nor are the details the only way an edit feature can work.

The only fixed part of the system's edit feature is the existence of a CartItem record and a method to supply the 'edit' link (or null if editing is not allowed).