Closed (fixed)
Project:
Commerce Core
Version:
7.x-1.x-dev
Component:
Cart
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
21 Jan 2011 at 14:07 UTC
Updated:
23 Nov 2017 at 15:18 UTC
Jump to comment: Most recent
Comments
Comment #1
netsensei commentedActually, come to think of it: the problem is that the unit price displayed on the line item manager is actually the price referenced from the product. I noticed that line items themselves don't store the price of a product.
Suppose 10 people order a product during the first week a product is out. After a week, the price on the product is changed by 25%. This will cause the line item display to show totally different pricing for those first 10 orders since the price of the line items is calculated dynamically.
The only reference people have of the original pricing on the order is their confirmation e-mail. If there's a dispute, there is no way for the store to retrieve the original order pricing.
Another problem: if an order is checked out, and payment gets delayed by 24h. Changes to the price in the order might corrupt the payment process as some payment gateways do a re-check after 24h and use the calculated amount as a verification parameter.
So, creating a separate field or even a entity property for line items which hold the unit price of a product at the time it was added to the cart would be the way to go me thinks.
Comment #2
pcambraThe price referenced in the line item of an order is separated from the original product price, line item entity has several files, one of them is the unit price of the products added to that line item.
The thing is that when you load an order which status is cart (as today "Shipping cart", "Checkout: Checkout", "Checkout:Review" have this status), the prices are recalculated in order to keep consistence with the product prices, you may have added a product last week to your cart, but the price of that product has raised, or there is a discount now that wasn't there last week...
You can change unit price and currency of orders in more advanced status, like Pending, Payment received and so on.
This commit adds a form alter to the line item edition that disables editing for unit price and currency code to avoid admins to get confused trying to edit some options that aren't really modifiable.
Pull request:
https://github.com/pcambra/drupalcommerce/commit/a20af1990a3853b5f1308c1...
Comment #3
rszrama commentedI've committed this fix for now. It doesn't mean we can't revisit this decision in the future, but I believe it will be a minority case where administrators will actually need to build shopping cart orders with custom pricing for a customer to checkout. I'm sure there will be use cases, but for now those will require either a separately priced product, a pricing rule, or perhaps a different type of line item. They can always modify the price after checkout is completed but prior to capturing the payment as well.
Comment #4
netsensei commentedOkay. I see. I was trying to change the order while it was still in the shopping cart. Changing the status to 'completed' allows me to change the unit price.
So, I agree with pcambra's patch.
Comment #7
manuelgc commentedHi,
I have a use case that admin require edit unit price in checkout_checkout status. When user (not same admin user) visit the order, the price change to product unit price.
I need to mantain custom price that admin set on line item order. This could be a use case similar to exposed here.
In other words, I need set custom price to line items orders in checkout_* status (not payment status).