Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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 CreditAttribution: googletorp commentedHow do you add the tax to the shipping line items?
Comment #2
googletorp CreditAttribution: googletorp commentedComment #3
freakalis CreditAttribution: 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 CreditAttribution: rszrama commentedComment #5
Summit CreditAttribution: Summit commentedHi, Could this be the problem for mine https://drupal.org/node/1243218#comment-7768183
greetings, Martijn
Comment #6
discipolo CreditAttribution: 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 CreditAttribution: discipolo commentedmy issue was related to discounts.
shipping taxes work for me.