On a kickstart site I have an order with a mismatch between the number of items in the order and the number of elements in the order total array (relevant section of the array from the order is at the bottom of this post ).
I haven't been able to recreate the problem with backups from the just before the order was created & completed but the customer ended up with an item in their completed order without any related charge.
Any idea what would cause this?
I guess there should be a check at some point in the order process to make sure that every item has an entry in the commerce_order_total array?
[commerce_line_items] => Array
(
[und] => Array
(
[0] => Array
(
[line_item_id] => 3352
)
[1] => Array
(
[line_item_id] => 3353
)
[2] => Array
(
[line_item_id] => 3354
)
)
)
[commerce_order_total] => Array
(
[und] => Array
(
[0] => Array
(
[amount] => 2995
[currency_code] => NZD
[data] => Array
(
[components] => Array
(
[0] => Array
(
[name] => base_price
[price] => Array
(
[amount] => 2604
[currency_code] => NZD
[data] => Array
(
)
)
[included] => 1
)
[1] => Array
(
[name] => tax|gst
[price] => Array
(
[amount] => 391
[currency_code] => NZD
[data] => Array
(
[tax_rate] => Array
(
[name] => gst
[display_title] => GST
[description] => Standard NZ GST for retail customers
[rate] => .15
[type] => vat
[rules_component] => commerce_tax_rate_gst
[default_rules_component] => 1
[price_component] => tax|gst
[calculation_callback] => commerce_tax_rate_calculate
[module] => commerce_tax_ui
[title] => GST - Retail
[admin_list] => 1
)
)
)
[included] => 1
)
[2] => Array
(
[name] => flat_rate_free_shipping
[price] => Array
(
[amount] => 0
[currency_code] => NZD
[data] => Array
(
)
)
[included] => 1
)
)
)
)
)
)
Comments
Comment #2
rszrama CreditAttribution: rszrama at Centarro commentedThe order total price array doesn't really work that way. It only sums the price components of line items by type - there is no association between components and line items. I'm not really sure what would've resulted in the extra product, though. Any further information we could use to track it down would be helpful.
Comment #3
AndyD328Thanks Ryan, it didn't look as though the array would make for simple checking, but some sort of check would be a 'good thing'.
The item was added to the cart with the add to cart button and there are no errors in the logs.
Even though the cart has 2 products and they show in the detail of the order the total on the orders page (admin/commerce/orders) and anywhere the total displays still only shows to cost of one product.
I'd love to provide some more info - what would help?
Comment #4
rszrama CreditAttribution: rszrama at Centarro commentedI'm really not sure what more info would be helpful. Typically we need to be able to reproduce an issue in order to debug it further, so we need a step-by-step workflow to cause the same error on a clean installation of Kickstart 2.x. Otherwise it's quite likely the issue is related to a third-party module.
Comment #5
AndyD328As I can't replicate it with the existing codebase & db I'm pretty sure I can't do it with a clean install. Leave it as postponed for a while and I'll have another go at getting to the bottom of it.
Comment #6
mglamanClosing