Question

Drupal's UberCart is a solution, where you select some product manually and then click "Add to Cart" button. But here goal is a bit different, I may have a custom javascript where user plays with catalog and attributes and selects product with properties in this window.

What would be the technological path to return selected products with properties back from js window to UberCart Cart?

Was it helpful?

Solution 3

I can see one solution as of now. To return customized selected products from js window to UberCart page, one could use js to reload parent window with actual Cart page and then, using js, add products as DOM elements to Cart html form. May be it's overcomplicated?

OTHER TIPS

There is a standard Ubercart module: Cart Links. After enabling it you'll be able to use URLs like /cart/add/p111_q5-imonday_special?destination=cart (p - product id, q - quantity).

This is the easiest way to work with UC's cart from JS.

I'm surprised that they do not offer this already 'out of the box', but searching their site turns up some user contributed attempts on this. Maybe one of those will work for you (or at least serve as a starting point for your own modification)?

It seems that at least one of those contributions turned into an 'official' drupal contribution, so you might want to check out Ubercart ajax cart on drupal.org.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top