In Dancer::Plugin::Interchange6::Cart::BUILD, when a cart-product is retrieved from the database, the "price" field is ignored:
price => $record->product->price,
Thus, if you have a custom price assigned (e.g., due to a discount), even though it gets stored in the table, the internal representation of the cart has the original products.price value.
In my case, I am repeating the custom calculation:
as it seems safest not to rely on the stored price at all -- for instance, the quantity might have been changed elsewhere, or the user may have changed identities (logging in, or changing a coupon in force, etc.). Alternatively you could take the less paranoid approach and:
This seems to be a bug:
In Dancer::Plugin::Interchange6::Cart::BUILD, when a cart-product is retrieved from the database, the "price" field is ignored:
Thus, if you have a custom price assigned (e.g., due to a discount), even though it gets stored in the table, the internal representation of the cart has the original products.price value.
In my case, I am repeating the custom calculation:
as it seems safest not to rely on the stored price at all -- for instance, the quantity might have been changed elsewhere, or the user may have changed identities (logging in, or changing a coupon in force, etc.). Alternatively you could take the less paranoid approach and: