2 replies [Last post]
xerbutter's picture
Offline
Bug Finder
Joined: 09/07/2007
Juice: 146
Was this information Helpful?

Hi All,

When a customer clicks on a product that has attributes in their shopping cart, I'd like them to be able to see and update those attributes, not get taken to a page where they add another of that product. The attributes they had selected would show up already filled out and the "add to cart" button would become an "update my cart" button.

For instance, picture the Dell purchase process. You select all these options...then when you review your shopping cart, you decide you want to add more RAM...you click on the computer in your shopping cart and it lets you update your selections. You don't have to start all over.

Any thoughts on the easiest way to implement this? Should I just use hook_cart_display to change the markup of the link so that it takes them to a custom page?

Thanks.

c0psrul3's picture
Offline
Joined: 10/07/2007
Juice: 95
Re: let customer review and update attributes from cart

i also have a need for this.
@xerbutter, have you made any progress?
seems to be around here:
line 1274 of uc_product.module

<?php
$element
['options'] = '';
 
alert($item);
  if (
module_exists('uc_attribute') && is_array($item->options)){
    foreach (
$item->options as $option){
     
$op_names[] = $option['attribute'] .': '. $option['name'];
    }
   
$element['options'] = array('#value' => theme('item_list', $op_names, NULL, 'ul', array('class' => 'cart-options')));
  }
?>

but $item doesn't include the other options.
if someone can help themeing the form so that we can query the db (yet again) to ask for all other options of the individual attribute then attribute modifications can be made, however then passing it to uc_product_update_cart_item, etc. etc.
if anyone has any input, that would be great!

xerbutter's picture
Offline
Bug Finder
Joined: 09/07/2007
Juice: 146
Re: Re: let customer review and update attributes from cart

I haven't made any progress on this yet, still figuring out how I want to tackle it.

I only have one product with attributes to worry about...so I'm thinking that the best thing may just be to edit the link in the shopping cart so that it points to a custom page. I could then put the attributes in that link or use a SESSION variable to get the info to that page. From there I'd use a custom form submit function to "update" instead of "add to cart", by calling uc_cart_remove_item then uc_cart_add_item.

Not the most elegant solution, but probably the quickest in this case... hope that's useful. I'll let you know if I do anything better than that.