
Order discounts are working fine, but product discounts do not. The website is using Commerce Product Attributes, and I think it has something to do with the fact that the product is actually $0. The attributes are getting assigned prices. When I enter a coupon code, the discount is applied as a $0.00 discount because it is calculating a percentage off of the product (which it thinks is $0.00). Then it sets the product price to $0.00 as well. When I reload the page, the discount disappears.
Comment | File | Size | Author |
---|---|---|---|
#6 | commerce_discount-product-discount-amount-2847475-6-7.patch | 1.11 KB | mirakolous |
#3 | commerce_discount-product-discount-amount-2847475-2-7.patch | 1.49 KB | mirakolous |
Comments
Comment #2
joelpittetPlease add more details on your setup and 'Needs Work' status is for when you've reviewed a patch that needs work, the status should be 'Active' Details here: https://www.drupal.org/node/156119#needs-work
Comment #3
mirakolous commentedI have a temporary fix here (I am sure there is a better solution). With this patch, I am basically just reloading the wrapper by loading the wrapper from the previous wrapper's ID. Then I set the older wrapper's field 'commerce_unit_price' with the reloaded wrapper's value from that field (which is the correct value).
Comment #4
joelpittetThanks for the patch @Mirakolous.
What is this addition serving?
$info = $wrapper->getPropertyInfo()
Comment #5
joelpittetIf we have reproducible steps it may be worth adding some simple tests if this fixes it (or something like this).
Comment #6
mirakolous commented@joelpittet Good catch I am updating the patch to remove that. I will try to reproduce on vanilla D7 site this weekend.
Comment #8
mirakolous commentedAs far as this issue goes, I tried installing a fresh D7 commerce site along with the product attributes module. It is clear to me that this will take hours just to get all of the modules configured properly for testing, and I do not have the time for that right now. I guess we should just call this an edge case for right now.
Comment #9
mirakolous commentedComment #10
joelpittetThe test failure is just because the patch isn't relative to the project's root. You can use
--relative
on thegit diff
, or remove the excess parts of the paths manually in the patch.Comment #11
joelpittetAh ok, leaving this closed, thanks for the update.
Comment #12
avpaderno