add product kit to cart from a view or link

Project:Ubercart Contributions
Component:Code
Category:
Priority:normal
Assigned:Unassigned
Status:active
Description
Project: 
Ubercart

Hi,

I think I found a small bug with the product kit:

I've created a product kit where the items are added to the cart individually, not as a unit. When clicking "add to cart" from the product page this works correctly. When clicking "add to cart" from a View or from a link (created with the new cart link API) the product is still added as a unit.

Thanks!

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6846
Re: add product kit to cart from a view or link

That is a problem. At least this gives me the opportunity to spruce up the product kit module a little bit.

I've fixed the discount fields so that they are more likely to have the product's original price as a default value. The Add to cart forms on the catalog page needed a hack to work the way they needed, but I figure that's OK since there's already some hackish code in it. The View handler for the Add to cart forms have been improved a little as well as working correctly.

xerbutter's picture
Offline
Bug Finder
Joined: 09/07/2007
Juice: 146
Re: Re: add product kit to cart from a view or link
Assigned to:Lyle» xerbutter

Thanks Lyle, that was fast! I just upgraded to the latest Bazarr and the views handler is indeed working correctly now. Great!

Unfortunately, there still seems to be a problem with Cart Links. I have a link setup as /cart/add/p305?destination=cart. p305 is a product kit with two items in it, but clicking on the link only adds one of those items to the cart. Any thoughts?

Thanks again.

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6846
Re: Re: Re: add product kit to cart from a view or link
Assigned to:xerbutter» Lyle

I thought I'd caught that case, too. Probably got a little excited with the Undo button at some point.

Run bzr update again and it should work.

xerbutter's picture
Offline
Bug Finder
Joined: 09/07/2007
Juice: 146
Re: Re: Re: Re: add product kit to cart from a view or link
Assigned to:Lyle» xerbutter

Yes, it's working great now. Thanks!

tgeller's picture
Offline
Joined: 09/21/2008
Juice: 8
I'm having problems adding a product kit via a cart link
Assigned to:xerbutter» tgeller

Re-awkening this old thread...

I created a product kit with three products. In Cart Link settings, I have "Display the cart link product action when you add a product to your cart" turned on. When I add the product kit, the following message appears:

    * Cart link product action: p6_q1
    * Cart link product action: p5_q1
    * Product 1 (CD-ROM) added to your shopping cart.
    * Cart link product action: p4_q1
    * Product 2 (CD-ROM) added to your shopping cart.
    * Cart link product action: p1_q1
    * Product 3 (DVD-ROM) added to your shopping cart.

So: I'm assuming the product kit itself is p6. Therefore I created a cart link as follows:

<a href="/cart/add/p6_q1?destination=cart">Add to cart</a>

But clicking on that link results in the following confirmation, followed by a long error. The kit *is* added to the cart... I just don't want my customers to see the error, and worry about repercussions from it. Here it is:

    * Cart link product action: p6_q1
    * Cart link product action: p5_q1
    * Product 1 (CD-ROM) added to your shopping cart.
    * Cart link product action: p4_q1
    * Product 2 (CD-ROM) added to your shopping cart.
    * Cart link product action: p1_q1
    * Product 3 (DVD-ROM) added to your shopping cart.

    * warning: Invalid argument supplied for foreach() in /home/tgeller/webapps/store/modules/node/node.module on line 561.
    * warning: implode() [function.implode]: Invalid arguments passed in /home/tgeller/webapps/store/modules/node/node.module on line 565.
    * user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 query: SELECT n.nid, n.vid, n.type, n.status, n.created, n.changed, n.comment, n.promote, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.picture, u.data FROM node n INNER JOIN users u ON u.uid = n.uid INNER JOIN node_revisions r ON r.vid = n.vid WHERE in /home/tgeller/webapps/store/includes/database.mysqli.inc on line 154.
    * warning: Invalid argument supplied for foreach() in /home/tgeller/webapps/store/modules/node/node.module on line 561.
    * warning: implode() [function.implode]: Invalid arguments passed in /home/tgeller/webapps/store/modules/node/node.module on line 565.
    * user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 query: SELECT n.nid, n.vid, n.type, n.status, n.created, n.changed, n.comment, n.promote, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.picture, u.data FROM node n INNER JOIN users u ON u.uid = n.uid INNER JOIN node_revisions r ON r.vid = n.vid WHERE in /home/tgeller/webapps/store/includes/database.mysqli.inc on line 154.
    * warning: Invalid argument supplied for foreach() in /home/tgeller/webapps/store/modules/node/node.module on line 561.
    * warning: implode() [function.implode]: Invalid arguments passed in /home/tgeller/webapps/store/modules/node/node.module on line 565.
    * user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 query: SELECT n.nid, n.vid, n.type, n.status, n.created, n.changed, n.comment, n.promote, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.picture, u.data FROM node n INNER JOIN users u ON u.uid = n.uid INNER JOIN node_revisions r ON r.vid = n.vid WHERE in /home/tgeller/webapps/store/includes/database.mysqli.inc on line 154.

Any ideas?

Many thanks,
--Tom Geller