Project:
UbercartCategory:
bug reportVersion:
Ubercart 1.3Priority:
normalAssigned:
UnassignedStatus:
patch (needs work)I created a product kit witch have two product. Kit have 1 qty first product and 2 qty second product.
When I update second product, UC say:
The Product kit has been updated.
The Product has been updated.
And after then, product kit have 1 qty firs product and 2 qty second product.
The bug was founded and fixed.
I hope that someone can review this patch.
| Attachment | Size |
|---|---|
| uc_product_kit.patch | 578 bytes |



Patch doesn't work
Once I change the code, nothing gets updated. Have had to change back
What is the correct update to make here?
Thanks
Re: Patch doesn't work
I'm not sure what this patch is trying to accomplish, but I don't think it does it. Since I don't know what the original problem was, I can't tell if the latest version fixed it or not.
Re: Re: Patch doesn't work
Original code get produts arrays of product kit key to $i varibale value. This is not work. Right value is product id is in products arrays value, not key.
I used Ubercart 1.3.
Re: Re: Re: Patch doesn't work
I think I remember changing it so that the products array had the product id for both the key and the value. In that case, the problem was fixed, but in a different way.
The problem is still not fixed for me for some reason
version 1.6 is still giving me the same problem
Please help
Re: The problem is still not fixed for me for some reason
OK, I finally figured out what was going on. At this point, I'm not sure why the patch didn't work. It may have been because the drupal_execute() call in uc_product_kit_nodeapi() wasn't getting any values to work with. I've committed a very similar patch with that addition, so the latest Bazaar build should work now.
Still not working
Hi Lyle
Thanks for your help on this.
I downloaded the latest version from Bazaar and installed it. I then go to one of my product kits and try change the quantity. It gives me this error:
Fatal error: Call to undefined function dpm() in /usr/www/users/climaxw/modules/ubercart/uc_product_kit/uc_product_kit.module on line 137
Anything else I was meant to have updated or uploaded for it to work?
Thanks
By the way
I am using 5.12, in case the dpm function is a v6 call?
D'oh! I meant to take those
D'oh!
I meant to take those out. That's a function from the Devel module. You can just delete those lines, but I'll take care of it right away.
Still not working again
Hi Lyle
I'm really sorry - this is proving to be a bane of your existence...
But the updated product kit module still doesn't work...
I have a number of product kits, which each use a product as a component, they have different quantities of the base product in them. I go to the product component and change the price:
- The good news is that it no longer resets the quantities in the product kits to zero.
- The bad news is, that now it doesn't update the price of the product in the product kit, thus updating the total product kits price
- If I go to the product kit and manually delete the "discount" text box", then the product kit looks up the new price from the updated product component and everything is fine. The problem is, I can't go and do this for each product kit every time I change the component price.
Please HELP!
Thanks
Re: Still not working again
OK, I've got some bad news. If your product kit is using the same price of its components, they're not going to update automatically. It's got to do with the bad handling of NULL in db_query(). What you can do is set the discount to -0.01, so that the price of the product kit will be really close. Then you can adjust the product's price, and the kit should update as normal.
Re: Re: Still not working again
Any updates on this? Product kits are pretty crucial to my website and they just don't work right. Right now my prices update correctly but the quantities get reset all the time. Am I understanding correctly that if I update so that the quantities stay set it will break price updating?
Re: Re: Still not working again
@Lyle - can we not provide an alternative? I don't like the idea of people having to use a random workaround like this.
Re: Re: Re: Still not working again
The fix for the quantities being reset was made after 6.x-2.0-beta1 was released, so you will need to get the code from our Bazaar repository. A beta2 release will happen soon, so you can wait for that if you like.
The quantity fix won't break price updates because, frankly, they're already (very slighty) broken. Setting the product discount to 0 will cause it to stay at whatever price that product is, even if the product's price is updated later. That's the same as putting a positive number as a discount. Actual negative numbers in the discount field will work correctly.
Re: Re: Re: Re: Still not working again
Now I'm really confused....
My kits are simply the individual parts added up and the prices do update correctly... if I change a products price the kits price is changed automatically.
If I edit a product kit I see that each individual product in the kit has a box labeled "Discount:" with the description "Enter a negative value to lower the item price by that amount. Enter a postive value to set the item price to that amount." Each of these boxes is automatically filled (I have never typed anything there or changed any of them) with the individual products price. Why would it be set to 0?
Re: Re: Re: Re: Re: Still not working again
Well, I guess you wouldn't.
I went to check, and I was mistaken: setting the discount to 0 means that that product doesn't contribute to the kit price. Basically, it's free.
I imagine that you don't modify your product kits after you create them. This means that no discount has been entered yet, so the kit price is always calculated from the products' prices. However, once you edit the product kit again and submit the changes, the discount is locked in and it won't update off the product price any more. And it's because of how the discount is stored in the database, so there's not any value that you can enter that would cause it to go back to the way it was once it's been entered.
Re: Re: Re: Re: Re: Re: Still not working again
Sorry to beat this to death but one more question....
You say that the fix was made in the 6x line. If I am using Ubercart 1.6 on Drupal 5x is there a fix available?