Hi,

I am trying to solve a problem with the commerce_email module, which puts a quantity of "1" into the quantity column of all products within an order that are not of type "product" - resulting in all pricetable products being listed as quantity "1", but with the correct price calculation ...
The reason for posting this here instead of the commerce_email issue cue is that I cannot find the place (database or wherever) where the actual quantity of an ordered product-with-pricetable is stored. I can easily find the quantity of a "normal" product from the line_item_wrapper, but it seems pricetable products don't keep their ordered quantity there?

Any help would be highly apreciated, I could then post a hack to correct commerce_email (and would volunteer to post that hack at that module's issue cue as well).

Comments

malbrecht’s picture

Assigned:Unassigned» malbrecht
Status:Active» Closed (fixed)

Never mind, it just seems the quantity is set a bit later into the field "quantity", just where it's supposed to be.

So the problem with commerce_email displaying the wrong quantity for pricetable items can be solved by correcting the line 128 in "commerce_email.module":

Original

array('data' => 1, 'style' => array('text-align: left;')),

should be replaced by

array('data' => intval( $line_item_wrapper->quantity->value()), 'style' => array('text-align: left;')),

(or without "intval" if float would be acceptable?).