I have noticed in a new install of suite 7.10.7 when inside a quote and adding line items,
if you choose a product with a price all the fields with prices in them will change to NaN.
after some investigation, I found that the id for the currency (“product_currency{LINE_ITEM_INDEX}”) to use inside the name_to_value_array coming back from the popup window
is “-99.00” instead of -99
because of this when it comes to setting the conversion rate to the product_currency_rate variable from the get_rate function, it returns back undefined instead of in this case 1.
every math function after that will then be trying to divide a value by undefined which fills everytthing with NaN’s
I don’t know what is causing the problem (products with no value i.e. £0.00 return back correct id -99)
but to patch over it client side edit the in the file modules/AOS_Products_Quotes/line_items.js file
directly after
I don’t believe these issues are related.
parijke was indeed updating a drop down list incorrectly.
the value which is throwing off the calculations in line items for me is the id for the currency which if you have no additional currencies, the default currency id is -99.
after selecting the product from the pop_up window, the JSON object being returned from the server contains the malformed currency_id.
looks like it is being treated like a decimal value server side.
I want to dive into this a bit further but I haven’t figured out how the server deals with pop_up window requests
I’m interested to find out. @pgr do you know where in the source code I can find the functions/methods which fetches and sends the popup window data server side?
I’m planning to sprinkle in some extra log calls and hopefully shed some light on this.
I think it would be best to find out if this is something that may happen to other users and have a fix for it.
I don’t feel comfortable with my JavaScript patch as it will probably get nuked during updates.