I recently have opened this issue (which appeared not to be an issue) due to the fact that there was not enough information how price adjustments do work and what areas these adjustments will influence.
After the researching in source code and architectural concept, I have found out that the Price Adjustments should not affect item's prices/totals when being added to quote.
Magento uses them separately from total collectors in order to adjust prices before rendering on storefront (similarly to price.html in Magento 1.*).
In order to get these adjustments in quote and quote items, developer needs to move his adjustment's logic to separated service (calculator), implement the quote total collector and use his service from total collector as well as from adjustment.
If you need just to change the item price before totals you can implement your own price model for specific product type (or to the custom one, depends on your needs) and put the logic there. In this case, the price will be changed before being added to the shopping cart and will be also changed before showing on a storefront.
But in case if you want to do some price adjustments (for ex. web-shop fee, etc) you need to implement both - the adjustment model and the total collector. Adjustments are being used for run-time price calculation (when you are showing it on PLP or PDP) while total collectors are being used to make a final price calculation before the item will get added to the quote (and on totals recollection).
For instance, we have a tax calculator which adds the tax value on PDP and PLP using adjustments and adds taxes to quote items when the item gets added to quote using total collector. (the same exist for wee taxes)
With the total collector, you can add a new total row as well as change/modify quote item`s prices (depending on your needs).
Also an explanation of how to do price adjustments for quote items the right way would be super useful.
Essentially what's being asked for in this thread: https://community.magento.com/t5/Programming-Questions/How-to-add-custom-charges-fee-to-item-row-total-into-cart-for/td-p/34433
I'm guessing that part of Magento 2 isn't really streamlined yet..
It could be nice to have some information on who is going to do this, or if it's planned at all..
Help us improve DevDocs by creating a new topic about price adjustments. Refer to our Contribution guidelines for more information.
Acceptance criteria:
Your content must meet the following criteria:
Hello! We are archiving聽this聽ticket. Our Magento Community and Core developers and writers haven't had the bandwidth for an extended period of time to address this. We're archiving聽this聽in an effort to create a quality, community-driven backlog which will allow us to allocate the required attention more easily.聽If you believe that the reported problem needs further review, please open a聽new聽issue. Thank you聽for聽your continued collaboration and assistance!
Is a new topic about price adjustments still needed? I'm working on one and thought I'd ask.
Documenting the functionality will surely help it being used...
For the last two years and a half, I encountered numerous use cases where price adjustments would have been useful. But since it is undocumented and appeared far too obscure to me, I didn't use it.
I'm not even sure if it's working since Magento core doesn't use it.
@jeff-matthews Is this still an active need?
@goivvy, it appears that it is based on the feedback here! I can reopen and assign it to you.
That would be great.
Thanks for volunteering @goivvy!
@jeff-matthews Will adding a new total collector via etc/sales.xml be the correct way to do price adjustments for quote items?
@goivvy, I don't know the answer to that unfortunately.
@buskamuza, do you know the correct way to do price adjustments? If not, can you recommend someone who does?
The problem with total collectors is that it only adjusts totals, prices a customer sees on the cart page will be different to what he/she sees on product pages (if price adjustments are implemented).
@arthurlataks @Yonn-Trimoreau
@goivvy you make a point.
For my part, last use case I can think of is: in a B2B project, the ERP had a dynamic discounting system that I needed to call via web service each time a product was added to the cart. I sent the references and the quantities, and it sent me a list of adjusted prices back.
The customers were expecting these "magic" discount prices since they were already getting them when placing offline orders (by phone). And I could neither use tier pricing nor cart price rules since discounted prices were not predictable (and could not be translated in Magento price rules).
In that specific use case, discounts were not "explained" to customers (I mean not specifically listed and displayed in cart), but maybe price adjustments could add this functionality? Making it a dynamic way of discounting item lines without a predefined algorithm?
In any case, the "remotely defined discount price" case seems to be a valid use case for price adjustments. Do you agree?
@goivvy yes, I believe that is how the M2 team intended these mechanics to work. I see their stance here, on PLP/PDP you see a price + "tax" calculated together (for your convenience), and on a cart page you see a brake down of the price which was already counted into the price on PLP/PDP, which is inline with all the rest totals.