onclick="window.open('site.ru?addCart=<?php echo $product['product_id']; ?>')"
function $_GET(key) {
var p = window.location.search;
p = p.match(new RegExp(key + '=([^&=]+)'));
return p ? p[1] : false;
}
window.onload = function() {
cart.add($_GET('addCart'));
}