Hello,
I added a fee price component to my products (i.e. 10$) which adds a relative amount (i.e. 1$) to each line-item. The unit prices and total prices of that line-items on the checkout review pane appear correctly as a total (i.e. 11$). However, in the footer there is the Order:Total handler which prints:
Subtotal: 10$
Fee: 1$
Order Total: 11$
instead of only:
Order Total 11$
or with VAT enabled:
Subtotal: 11$
VAT: 0.50$
Order Total: 11.50$
The customer should neve see the fees. They are just for internal use (it's about a little marketplace and the fee is what the merchant has to pay to the shop owner - not interesting for the customers).
So the question is if it's possible that "Subtotal" is always calculated on the unit-price instead only of the base-price? Or equivalent: calculated on base_price component + all components with attribute "included = TRUE"?
In general I miss a function, that just returns the formatted/raw price of a line-item including all pricing rules and components. Or did I overlook it?
I'm not sure if it would help much if I wrote my own views area handler for that as the order summary also will be printed out in the order e-mail (and maybe additional places?).
Here's my $line-item->commerce_unit_price from the above example:
Array
(
[amount] => 1100
[currency_code] => USD
[data] => Array
(
[components] => Array
(
[0] => Array
(
[name] => base_price
[price] => Array
(
[amount] => 1000
[currency_code] => USD
[data] => Array
(
)
)
[included] => 1
)
[1] => Array
(
[name] => fee
[price] => Array
(
[amount] => 100
[currency_code] => USD
[data] => Array
(
)
)
[included] => 1
)
)
)
)
Comments
Comment #1
haggins commentedThe first problem is, that the Order:Total area handler uses a hardcoded display formatter. This should be exposed to options, imho.
And the second, harder to resolve issue, is that you cannot configure which components should be included and which not. Even commerce_price_components doesn't solve this issue as you can only configure which components will be display individually. You can't cumulate any components into the subtotal.
Maybe this should become a feature request?
Comment #2
rszrama commentedReading this issue afresh, it could actually have been solved by just using the base_price component. Then the price adjustment would only appear to the customer as part of the subtotal.