Re: Shopping Cart - similar issue
Re: Shopping Cart - similar issue
- Subject: Re: Shopping Cart - similar issue
- From: David Griffith <email@hidden>
- Date: Tue, 02 Mar 2004 17:04:25 +0100
HI all,
If someone can understand this and has an idea, please let me know.
I have a table of products (Product). Say there are 5 products in it.
I can get a list of these in an NSMutableArray and display it via a
repetition.
Now, I want to add a 'buy' link after each product and when it's clicked,
add it to my shopping cart. That's ok, I can do that. But I can only add 1
of each, rather than a user specified quantity.
So, I would like to put a form field (quantity) against each product
displayed, along with a 'buy' link. When I click buy, I want to add that
many to the cart.
Since the product table itself has no 'quantityToOrder' attribute if you
like, then how can I bind a quantity to each line of the repetition?
Regards,
Dave.
> Interesting that there was no response to this at all. Anyway, thought I'd
> post a message for anyone else that might be in the same boat at some stage.
>
> For some reason, I could not get this to work at all with a Display Group.
> I'm guessing this has something to do with the internal workings of it, or
> that I was doing something wrong.
>
> In the end, I created my own simulated Display Group (in other words just an
> NSMutableArray of the values which I display in the same way as a Display
> Group, and using a form around the whole thing, I can place a quantity form
> field in the repetition which is linked to cartItem.cartItemQuantity. This
> permits me to get the value for each entry in the Array and update the whole
> cart accordingly.
>
> Regards,
> Dave.
>
>> Hi all,
>>
>> I have a shopping cart table and a cart items table.
>> The EditShoppingCart component uses a display group to show all the cart
>> items.
>> Each cart item has a quantity value that I need to update using a form entry
>> field.
>> This means there could be many entry fields with quantities displayed in
>> them, and these can be edited by the user.
>> When the user clicks update9 I want it to update other values in each row
>> of the displayGroup and save them all back to the database.
>>
>> Can someone tell me the procedure I should use?
>>
>> If the Item9 binding of my WORepetition for example is a CartItem, and each
>> element in the WORepetition displays by having a binding like
>> cartItem.prodName9, then should I bind the cartItem.quantity to the Form
>> element for editing the quantity? I think this won9t work but am not sure.
>>
>> Then, when the update button is clicked, should I step through the display
>> group myself, make the changes, and then do an ec.saveChanges?
>>
>> If so, how do I step through the display group, and how would I identify the
>> value of cartItem.quantity in the java code?
>>
>> I9m sure this is pretty straight forward but I could do with some pointers
>> :-)
>>
>> Regards,
>> Dave.
>> _______________________________________________
>> webobjects-dev mailing list | email@hidden
>> Help/Unsubscribe/Archives:
>> http://www.lists.apple.com/mailman/listinfo/webobjects-dev
>> Do not post admin requests to the list. They will be ignored.
> _______________________________________________
> webobjects-dev mailing list | email@hidden
> Help/Unsubscribe/Archives:
> http://www.lists.apple.com/mailman/listinfo/webobjects-dev
> Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.