*** Multi-Browser OcUK Shopping Cart Bookmarklet (similar to the Chrome extension) ***

  • Thread starter Thread starter Pho
  • Start date Start date
PHP:
javascript:(function() { var shoppingBasket = document.getElementById("shoppingBkt");  if(shoppingBasket == null) { alert("shopping basket not found"); return; }  var tbdy = shoppingBasket.getElementsByTagName('tbody')[0];  var rows = tbdy.getElementsByTagName('tr');  var str = "[COLOR=\"Yellow\"][b]YOUR BASKET[/b][/COLOR]\n";  var images = "";  var thumbnails = 'yes';  console.log('Your Basket');  for (var i=1; i < rows.length - 4; i++) { var row = rows[i];  var cells = row.getElementsByTagName('td');  if (row.className == "basket_option") { var inputs = row.getElementsByTagName('input');  /* a complete system with no option price or count */ if(inputs.length == 0) { var cell = cells[0];  for (var j=0; j <  cell.childNodes.length; j ++) { var option = cell.childNodes[j];  if(option.nodeName == "#text") { var desc = "[COLOR=\"Wheat\"]" + option.data + "[/COLOR]\n"; console.log('    option desc: ' + desc); str += desc; } } } /* a fully configurable build. */ else if(inputs.length == 1) { var desc = cells[0].childNodes[2].data; var qty = cells[1].childNodes[0].value; var price = cells[2].childNodes[0].innerText;  console.log('    option desc: ' + desc); console.log('    option qty: ' + qty); console.log('    option price: ' + price);  str += "[COLOR=\"Wheat\"]" + qty + " x " + desc + "[/COLOR]  [b][COLOR=\"Yellow\"]" + price + "[/COLOR][/b]\n"; } } else { var image = cells[0].childNodes[0].src; var desc = cells[1].childNodes[0].textContent; var link = cells[1].childNodes[0].href; var qty = cells[2].childNodes[0].value; var price = cells[3].childNodes[0].innerText; var total = cells[4].childNodes[0].innerText;  console.log('image: ' + image); console.log('desc: ' + desc); console.log('link: ' + link); console.log('qty: ' + qty); console.log('price: ' + price);  images += "[url=\"" + link + "\"]" + "[img]" + image + "[/img][/url] ";  str += qty + " x " + "[url=\"" + link + "\"]" + desc + "[/url]  " + "[b][COLOR=\"Yellow\"]" + price + "[/COLOR][/b]";  if(qty > 1) { str += " [b][COLOR=\"DarkOrange\"](" + total + ")[/COLOR][/b]"; } str += "\n"; } }  /* shipping costs */ var shipping = rows[rows.length - 3];  var shippingCells = shipping.getElementsByTagName('td');  var shippingValue = shippingCells[2].textContent;  /* grand total */ var total = document.getElementById('orderTotal');  var totalCells = total.getElementsByTagName('td');  var totalValue = totalCells[2].textContent;  console.log('Total: ' + totalValue + "(shipping " + shippingValue + ")");  str +=  "[b]Total : [COLOR=\"Yellow\"]" + totalValue + "[/COLOR][/b] " + "(includes shipping : " + shippingValue + ").\n";  /* thumbnails*/ if(thumbnails == 'yes') str += "\n" + images + "\n\n";  console.log(str);  window.clipboardData.setData("Text",str); })();

/*end of function */

Can you try this bookmarklet.

Basically, create a new shortcut in your favorite bar, and past the code (the first line in the code block) in place of the URL. Should do the same as the other script, but it is slightly different.

This one doesn't gives you code but copies the BB code block directly into the clipboard, like the old chrome extension used to do.
 
Copy into notepad, copy from note bad, IE9

YOUR BASKET
1 x Intel Core i7-3930K 3.20GHz (Sandybridge-E) Socket LGA2011 Processor - OEM[/url] £455.99
1 x Corsair PC Starter Bundle 2000c - 600TM Case / TX 850W V2 PSU / H80 CPU Cooler (Cooler Half Price)[/url] £284.98
1 x HIS ATI Radeon HD 6950 IceQ X Turbo 2048MB GDDR5 PCI-Express Graphics Card with FREE Deus Ex PC Game[/url] £214.99
1 x Crucial RealSSD M4 128GB 2.5" SATA 6Gb/s Solid State Hard Drive (CT128M4SSD2)[/url] £149.99
1 x Kingston HyperX Genesis 8GB (4x2GB) DDR3 PC3-12800C9 1600MHz Dual/Quad Channel Kit (KHX1600C9D3K4/8GX)[/url] £37.99
Total : £1,158.94 (includes shipping : £12.50).
[/url] [/url] [/url] [/url] [/url]
 
YOUR BASKET
1 x Intel Core i7-3930K 3.20GHz (Sandybridge-E) Socket LGA2011 Processor - Retail[/url] £499.99
1 x Corsair Professional Series AX1200 High Performance 1200W Modular '80 Plus Gold' Power Supply (CMPSU-1200AXUK)[/url] £244.99
1 x Asus P9X79 PRO Intel X79 (Socket 2011) DDR3 Motherboard[/url] £226.99
1 x HIS ATI Radeon HD 6950 IceQ X Turbo 2048MB GDDR5 PCI-Express Graphics Card with FREE Deus Ex PC Game[/url] £214.99
1 x Crucial RealSSD M4 128GB 2.5" SATA 6Gb/s Solid State Hard Drive (CT128M4SSD2)[/url] £149.99
1 x Kingston HyperX Genesis 16GB (4x4GB) DDR3 PC3-12800C9 1600MHz Dual/Quad Channel Kit (KHX1600C9D3K4/16GX)[/url] £74.99
1 x Corsair Carbide 300R Mid Tower Case - Black[/url] £59.99
1 x OcUK 22x DVD±RW SATA ReWriter (Black) - OEM[/url] £17.99
Total : £1,504.92 (includes shipping : £250.82).
[/url] [/url] [/url] [/url] [/url] [/url] [/url] [/url]

Copied into notepad first. So it's something to do with how IE interprets the code on the forum!?
 
IE seems to handle things quite differently on here. For instance, in Chrome if I preview a post, the message box remains the same. In IE it changes. Like this:
hitXM.jpg.png

EDIT: To be clear, for you in IE9 it is all okay?

just wait a minute... It's converting the BB code into html already at this stage? That's naughty. What you paste in the post should be what's generated in the shopping cart webpage.
 
YOUR BASKET
1 x Intel Core i7-3930K 3.20GHz (Sandybridge-E) Socket LGA2011 Processor - Retail[/url] £499.99
1 x Corsair Professional Series AX1200 High Performance 1200W Modular '80 Plus Gold' Power Supply (CMPSU-1200AXUK)[/url] £244.99
1 x Asus P9X79 PRO Intel X79 (Socket 2011) DDR3 Motherboard[/url] £226.99
1 x HIS ATI Radeon HD 6950 IceQ X Turbo 2048MB GDDR5 PCI-Express Graphics Card with FREE Deus Ex PC Game[/url] £214.99
1 x Crucial RealSSD M4 128GB 2.5" SATA 6Gb/s Solid State Hard Drive (CT128M4SSD2)[/url] £149.99
1 x Kingston HyperX Genesis 16GB (4x4GB) DDR3 PC3-12800C9 1600MHz Dual/Quad Channel Kit (KHX1600C9D3K4/16GX)[/url] £74.99
1 x Corsair Carbide 300R Mid Tower Case - Black[/url] £59.99
1 x OcUK 22x DVD±RW SATA ReWriter (Black) - OEM[/url] £17.99
Total : £1,504.92 (includes shipping : £250.82).
[/url] [/url] [/url] [/url] [/url] [/url] [/url] [/url]
(without previewing first)
 
IE9 edit post,

Untitled-5.png
 
YOUR BASKET
1 x Intel Core i7-3930K 3.20GHz (Sandybridge-E) Socket LGA2011 Processor - Retail[/url] £499.99
1 x Corsair Professional Series AX1200 High Performance 1200W Modular '80 Plus Gold' Power Supply (CMPSU-1200AXUK)[/url] £244.99
1 x Asus P9X79 PRO Intel X79 (Socket 2011) DDR3 Motherboard[/url] £226.99
1 x HIS ATI Radeon HD 6950 IceQ X Turbo 2048MB GDDR5 PCI-Express Graphics Card with FREE Deus Ex PC Game[/url] £214.99
1 x Crucial RealSSD M4 128GB 2.5" SATA 6Gb/s Solid State Hard Drive (CT128M4SSD2)[/url] £149.99
1 x Kingston HyperX Genesis 16GB (4x4GB) DDR3 PC3-12800C9 1600MHz Dual/Quad Channel Kit (KHX1600C9D3K4/16GX)[/url] £74.99
1 x Corsair Carbide 300R Mid Tower Case - Black[/url] £59.99
1 x OcUK 22x DVD±RW SATA ReWriter (Black) - OEM[/url] £17.99
Total : £1,504.92 (includes shipping : £250.82).
[/url] [/url] [/url] [/url] [/url] [/url] [/url] [/url]

(unselected that button top right and didn't preview)
 
YOUR BASKET
1 x Asus Maximus IV Extreme Intel P67 (Socket 1155) DDR3 Motherboard ** B3 REVISION **[/url] £299.98
1 x MSI ATI Radeon HD 6970 2048MB Twin Frozr III GDDR5 PCI-Express Graphics Card with FREE Deus Ex PC Game[/url] £275.99
1 x Gigabyte X58 G1 Guerilla Intel X58 (Socket 1366) DDR3 Motherboard - Gaming Series[/url] £199.99
1 x Asus P67 Sabertooth Intel P67 (Socket 1155) DDR3 Motherboard ** B3 REVISION **[/url] £145.98
1 x Compro VideoMate S350 Digital Satellite TV Card - Retail [/url] £20.99
Total : £954.92 (includes shipping : £10.00).
[/url] [/url] [/url] [/url] [/url]
 
Back
Top Bottom