Price + Shipping = Total

By vbrtrmn Last update Jul 9, 2010 — Installed 3,508 times.

Not working in ebay.it

in
Subscribe to Not working in ebay.it 8 posts, 8 voices



Borghy User

Hi.
In *.ebay.it I receive $NaN for all object...
Could you please tell how to edit the script to adapt to ebay.it?

Thanks
Borghy

 
vicious User

That happens on eBay.com too. To fix it change the line
var price = parseFloat(rows[i].getElementsByClassName('prices')[0].innerHTML.replace(/^\+\$/,''));
into
var price = parseFloat(rows[i].getElementsByClassName('prices')[0].innerHTML.match(/\d+.?\d*/));

 
knastmutti User
FirefoxWindows

to make it work on many more countries, i fixed an issue with the parsefloat funtion which didnt worked correctly. It struggled converting floating point numbers in string form to real floating point number variables. I replaced "," with "." and vice versa.

just replace

"var price = parseFloat(rows[i].getElemen.....

.......col.innerHTML = '$'+ total;"

with ..

var price = rows[i].getElementsByClassName('prices')[0].innerHTML.match(/\d+.?\d*/);
price = price.toString().replace(/,/g,'.');
price = parseFloat(price);
var ship = rows[i].getElementsByClassName('ship')[0].innerHTML.replace(/\+EUR /,'');
ship = ship.toString().replace(/,/g,'.');
ship = parseFloat(ship);
ship = (isNaN(ship)) ? 0 : ship;
var total = (ship+price).toFixed(2);
var col = td.cloneNode(true);
col.innerHTML = '??'+ total;
col.innerHTML = col.innerHTML.replace(/\./g,',');

Vicious's part is already included. It should work on all europoean ebay sites.

 
zeecee User
FirefoxWindows

Vicious' correction fixed it for ebay.com (US). Thank you!

 
vbrtrmn Script's Author
FirefoxMacintosh

The script needs an update, I'll try to get to it in the next couple weeks.

 
polyvinyl User
FirefoxWindows

Appears to have stopped working on ebay.com (US). =(

 
ATLien User
FirefoxWindows

Yep...not working for US eBay.

 
nicorac Scriptwright
FirefoxWindows

My own version of the script here:
http://userscripts.org/scripts/show/91136

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel