When used with Commerce Customizable Products module, a discount is not applied to that specific item at checkout.
I am using commerce discount module with the lastest dev, along with the coupon module's latest version. Also Commerce Customizable Products 7.x-1.0-beta2, the lastest release.
When a coupon is entered during checkout, it is applied to all products that do not use commerce custom product fields . However, any item in checkout that has commerce custom product fields (and they have been filled out), the discount is not applied to these products only. All other products still get the discount.
In the event the item has the custom fields, but they are not filled out, the coupon works.
In the event there is only one item in the checkout, and it has custom fields and they are filled out, the coupon gives the applied message on screen (but it doesnt actually display the discounted amount, nor apply it).
No error message is given on screen or in the logs.
I have tried every which way, and discounts are only not applied to the products with custom fields that have been filled out by the customer. Every other product works fine.
I added the fields per the Commerce Guys Tueday video: http://www.commerceguys.com/resources/articles/272 , so nothing strange there.
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | support_all_product-2410283-12.patch | 2.59 KB | mglaman |
| #12 | interdiff-2410283-10-12.txt | 1.15 KB | mglaman |
| #10 | support_all_product-2410283-10.patch | 1.61 KB | mglaman |
| #6 | Untitled1.jpg | 23.51 KB | drupal_simply_amazing |
Comments
Comment #1
mach5_kel commentedComment #2
mach5_kel commentedgrammer
Comment #3
mach5_kel commentedI attempted to manually adjust the order, by finding the order number, choosing edit.
I choose "fixed amount discount", add line item.
I got the following error when I clicked save. (And no discount was applied).
Notice: Undefined property: stdClass::$commerce_unit_price in commerce_line_item_manager_validate() (line 1228 of /home/content/35/12580935/html/sites/all/modules/commerce/modules/line_item/commerce_line_item.module).
Comment #4
mr.andrey commentedI'm experiencing the same thing.
Comment #5
drupal_simply_amazing commentedI got the same bugs. When using Commerce Customizable Products the discount is not applied on checkout.
Comment #6
drupal_simply_amazing commentedWe've figure out that you just need to include the line items you created using the Commerce Customizable Products "admin/commerce/store/discounts/settings".
Comment #7
joelpittet@drupal_simply_amazing so this is resolved according to #6?
Comment #8
mglamanChanging component to documentation. This is a huge documentation pitfall that I forget all the time. Tagging for weekly sprint to see if someone can get the documentation node updated about custom line items and discounts. Or maybe we could make it a feature request to automatically include all product line item types?
Comment #9
mglamanSo I was thinking on this issue and realized it isn't just for Commerce Customizable Products created line items. This issue affects all custom product line item types. I'm proposing we change the default value of commerce_discount_line_item_types to include all line items returned from commerce_product_line_item_types().
Comment #10
mglamanhere is a patch which allows all product line item types, sans the Commerce Discount product_discount type.
Comment #12
mglamanFix some logic for checking line item bundles and enabled bundles.
Comment #13
joelpittetThat looks reasonable, I guess we can't auto-include them if new types are added?
Comment #14
mglaman:) rszrama had the same question. I think we could listen in on hook_modules_enabled() for ones provided in code to automatically add them if variable is saved, ditto to hook_commerce_custom_product_line_item_type_insert().
Want me to roll patch that does this? It makes sense. But at same time I'm 99% against modifying a saved variable if someone has already gone and saved the form its in (or saved it.)
Comment #15
joelpittetI'm not sure it's a good idea, it was just a thought so we cover our bases.
RTBC, @rszrama can commit if he's ok with this.
Comment #16
jkuma commentedThis patch is a good working approach to solve this issue but it doesn't remove the logic. it would be nice to get rid of "$line_item_types" var and remove the logic around it.
Comment #17
mglamanjkuma, #16 doesn't make sense. We still want it to be configurable. Maybe the title of the issue needs to be changed to "by default."
Comment #18
jkuma commentedOk mglaman,
I thought you wanted to completely remove this configuration setting. The code looks good to me, i'm re-updating this issue to RTBC.
Comment #19
joelpittetCommitted, thanks for all the -dev