First let me say - this module is extremely useful. Thank you very much. It will definitely be used in the site I am working on at the moment.
The problem I think I have uncovered can be observed if you try to set a price that contains 'cents'. When you save and then view the results you will see a '
.000' in the DB or in the product edit form.
I think I have found the issue with the way product multiprices are stored in the DB. Looking at the insert query in the code it contains the following:
db_query("INSERT INTO {uc_multiprice} (nid, country_id, list_price, cost, sell_price) VALUES (%d, %d, %d, %d, %d)",
$node->nid, $country_id, $country['list_price'], $country['cost'], $country['sell_price']);
My VERY limited understanding of PHP suggests that this means the data (for the list, cost and sell prices) would be converted to an integer before being inserted in the DB. If I change the above line to read it all seems to work fine:
db_query("INSERT INTO {uc_multiprice} (nid, country_id, list_price, cost, sell_price) VALUES (%d, %d, %f, %f, %f)",
$node->nid, $country_id, $country['list_price'], $country['cost'], $country['sell_price']);
(note the changing of the price formats)
Regards and thanks once again for a very helpful module
Adam
Comments
Comment #1
Docc commentedThis issue already has been fixed in HEAD a while back ago.