I have a bunch of feeds importing commerce products with CSV files provided by the client. I use tamper to turn the real-world 99.99 dollars-and-cents values into the 9999 cents prices that commerce expects. The client's most recent file for some reason double-quote-delimits all the prices over $999.99. (No idea why: they don't use a comma delimiter.)
What tamper does with this is quite problematic: the $field value passed to feeds_tamper_math_callback() is a string in the format "1,119.94" (perhaps formatted by commerce first? I haven't investigated). PHP implicitly casts this to a float val of 1 when the multiplication happens, meaning all prices over $999.99 are imported as $1.00.
Could feeds tamper please throw an error or display a message if (!empty($field) && !is_numeric($field)) when trying to do math on $field?
Comments
Comment #3
twistor CreditAttribution: twistor commented