We need a way to manipulate the price of an order total or the unit price of line items. We have decided upon using an Adjustment object to represent a price, and fields on line items and orders that take these into consideration when calculating their totals.

Work has been done for some time over on https://github.com/drupalcommerce/commerce/pull/447

Comments

mglaman created an issue. See original summary.

mglaman’s picture

StatusFileSize
new35.97 KB

Here is patch from the PR. Using GitHub for the patch was wonkering out.

borisson_’s picture

StatusFileSize
new2.74 KB
new36.74 KB

I think this looks great. I changed a few small things around in the constructor of the adjustment object, to remove a else-block that wasn't needed and added extra unit-test coverage for the constructor as well.

mglaman’s picture

Thanks! I've added that, working on the UI again now.

mglaman’s picture

Status: Needs work » Needs review

Tests passing. Research against other systems done for order level adjustments. Just want bojanz's thumbsup before merge.

  • bojanz committed 83e6660 on 8.x-2.x authored by mglaman
    Issue #2779105 by borisson_, mglaman: Provide a method to allow price...
bojanz’s picture

Status: Needs review » Fixed

Joy to the world!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.