Active
Project:
Commerce Flat Rate
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
29 Aug 2012 at 11:49 UTC
Updated:
8 Jun 2014 at 13:34 UTC
Jump to comment: Most recent
I don't know if this problem originates in commerce core, commerce shipping or commerce tax.
When loading a commerce order ex: (from commerce_reports module)
$wrapper = entity_metadata_wrapper('commerce_order', $order);
$order_data = $wrapper->commerce_order_total->data->value();
foreach ($order_data['components'] as $component) {
if (!empty($component['price']['data']['tax_rate'])) {
// Component has tax info in price
}
}
But when the component is a shipping line_item tax_rate is not loaded in the data price array.
Example: Order with 1 product 6% tax and shipping with 25% tax. No tax data is loaded to the shipping component

| Comment | File | Size | Author |
|---|---|---|---|
| 20120829-d8138c5d58u12ydnrd5nuyee6c.png | 79.88 KB | freakalis |
Comments
Comment #1
googletorp commentedHow do you add the tax to the shipping line items?
Comment #2
googletorp commentedComment #3
freakalis commentedIm using Commerce shipping and Commerce Flat Rate http://drupal.org/project/commerce_flat_rate. You can choose tax when configure the cost for shipping.
Comment #4
rszrama commentedComment #5
summit commentedHi, Could this be the problem for mine https://drupal.org/node/1243218#comment-7768183
greetings, Martijn
Comment #6
discipolo commentedi also noticed that the taxes i add to my shipping flatrate arent working if i use commerce_discounts. once i disable the discount rules (which for some other reason happens to me on cacheflush anyway) the shipping tax is included in the tax component of the order total as expected.
not sure yet if this is related to commerce discount or any of the patches i am using or something else.
Comment #7
discipolo commentedmy issue was related to discounts.
shipping taxes work for me.