Closed (outdated)
Project:
Commerce Product Bundle
Version:
7.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
11 Mar 2012 at 16:24 UTC
Updated:
14 Dec 2021 at 06:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Elementica commentedI've tried everything... following the steps I have:
- made a product type "item"
- made two products "A" and "B" of "item" type
- made a content-type "display item" that references products "item"
- made one display for "A" and one for "B"
- made a product type "kit" with two reference fields to products "item" (with "product bundle: add to cart form")
- made one product "AB" of "kit" type with a price of "0" and referencing "A" and "B"
- made a content-type "display kit" that references products "kit"
- made one display for "AB"
"AB" is shown as a simple product with a standard "Add to cart" button and its price ("0" in my case).
What can I check? I'm not sure what to look at...
Comment #2
Elementica commentedI'm also testing the "dev" version, but nope... moreover reverting display settings of referencing fields to "A" and "B" to a simple "Add to cart", display of "AB" gets corrupted (entity wrapper error): taking it back to "product bundle: add to cart form" restores display.
Comment #3
olafkarsten commentedJust for sure: check if the rule 'Calculate Bundle Product Price' is active.
Comment #4
Elementica commentedSpeaking about default rule set by the module... yes: haven't ever disabled it.
I'm not sure what I can check/log to debug this. I think there could be some problems related to "line items"... e.g. I haven't understood the use/meaning of "Bundle Item" line item created by the module...
Comment #5
js commentedI am having the same issue. I have three product references that reference multiple products.
The total when added to the cart is correct, but the price in the "product display" never change from the initial default, which is the combined total of the first product within the products. (confusing, isn't it.)
Comment #6
bob.hinrichs commentedSame issue here. This was working in the previous version before 7.x-1.0-alpha6, but now it no longer works.
Output of Calculate Bundle Product Price Rule:
44.672 ms Evaluating conditions of rule Unset the price of disabled products in the cart. [edit]
46.558 ms The condition data_is_empty evaluated to TRUE [edit]
46.575 ms AND evaluated to FALSE.
46.611 ms Finished reacting on event Calculating the sell price of a product.
Comment #7
xbrianx commentedI seem to be having an issue similar to this, When i select the bundled item and click add to cart, it does not add the main product item to the cart, rather only adds the selected bundle item. Any ideas on this one?
Comment #8
olafkarsten commentedCan somebody confirm, the issue still exist with the actual dev version from yesterday?
Comment #9
olafkarsten commentedshould be a bug, if it doesn't work
Comment #10
olafkarsten commentedIn my case it works as long as I set the 'Number of values' for the product reference fields of the product bundle type to 'unlimited' or any number greater than 1. Don't know why, but it works for me.
Comment #11
Susurrus commentedSo, this problem still exists and was causing problems. Changing the number of products that you can reference with a single field as olafkarsten in #10 suggests, fixed the issue for me when viewing the shopping cart block, but not when actually going to checkout. I've found that the correct solution is to run the
EntityFieldQuery()incommerce_product_bundle_get_sub_line_itemsas an administrator as there are permissions issues for anonymous users andEntityFieldQueryuses the permissions of the current user. The fix is to add to theEntityFieldQuery()atcommerce_product_bundle.module:1396a->addMetaData('account', user_load(1))line. So mine ends up looking like:I'm pretty certain this is a safe operation because this query isn't querying a specific line item, it's querying for the structure behind the line item type.
Comment #12
maciej.zgadzaj commentedI had an occasion to briefly play with this module.
And, first thing, I confirm what olafkarsten said in #10, setting Number of values field to Unlimited for ALL product reference fields helps. But it is not really a proper solution in any way.
There are actually 2 issues here, both apply to
commerce_product_bundle_calculate_price()function (Calculate the price of a bundle product rule):1. One is the way
$sub_productis being fetched using that funnyforeach ($product->{$product_field_name} as $sub_product)loop.In my case I had 3 product reference fields, 2 of them filled, 3rd one empty. With this loop I was getting product referenced in 2nd field in 3rd field as well. Wrong, as it should be empty there. It was just keeping the old value there, as it never was getting into the loop for the 3rd field (as there was nothing to loop through).
2. Second issue was with prices being used. That
$commerce_total['amount'] = $quantity * $sub_product->commerce_price->amount->value();takes price directly from$sub_product->commerce_price, but this is only the initial price, before any pricing rules are run on it. Again, wrong, as this means no possibility of changing the price through rules, no VAT, no sales tax, no anything.Attached patch fixes both those issues.
I am not 100% sure that it does everything it should do, haven't played with it long enough, so if anyone feels like testing and confirming that it works (or doesn't, and what exactly then) you'll be more than welcomed!
Also, changing to Major as this is pretty serious. (And yes, it still exists in 7.x-1.x just checked out from git repo.)
Also, the "patch" from #11 is not necessary.
Also, the
commerce_product_bundle-bundle_price-1477584-11-exclwl.txtfile is not a proper patch, it is there just to make reading it easier, as it does not include white space changes.Comment #13
maciej.zgadzaj commentedComment #14
maciej.zgadzaj commentedActually, the same changes should be applied to the case when
$multiply_by_quantityis not true.Comment #15
kscheirerIs this still an issue with the latest dev? I committed #2374509: Default total price incrementing by previous referenced product price if product reference field is empty which should solve problem #1 identified above. I do like the way you're using commerce_product_calculate_sell_price() instead of grabbing the value directly. Making this change might also solve some issues that crop up using Entity API without try/catch blocks.
Comment #16
pifagorI eroryt previous patch, I corrected it, worked.
Comment #17
pifagorComment #18
hunziker commentedComment #19
pifagorComment #20
unl0ck commentedI understand that the module is no longer supported, but it is very suitable for my task. The only problem is with the recalculation of the cost. With the first patch nothing changes, with the second it displays an error. Or maybe someone knows another way to implement similar functionality. Last version Drupal 7 with module drupal commerce
Comment #21
olafkarsten commentedClosing. No development for D7 anymore.