This question has been flagged

Hello my friends:

In my portal, i need to make an event listener on a link.

I habe tried this but it does not work, would anyone help please.

<button class="toto"><a t-att-href="'/shop/product/%s' % slug(product)" class="btn btn-link js_see_product">Show product</a></button>

My js:


$(document).ready(function() {
$('.toto').click(function (ev) {

ajax.jsonRpc('/shop/cart/update_json', 'call', {
"product_id": parseInt(product_id.value),
"add_qty": 1,
"display": true
}).done(function () {
console.log('ok')
})
});
})
Avatar
Discard