Post by JonathanR » Thu Mar 02, 2017 7:10 pm

Hello all,

Can anyone point me in right direction as to how OC 2 now referecenes the Add to cart buttons on both the category page and the product page.

I need to configure Google Tag Manager what to track when the add to cart button is clicked on both the product page and category page, but as nothing is actually triggered to load as such, I need to work out what the trigger is. Maybe the green success alert box which appears can be used?

I've looked at the source code and css, but them seem to not quite be called anything I can use.

Thanks in advance.

New member

Posts

Joined
Sun Apr 15, 2012 4:34 pm

Post by paulfeakins » Thu Mar 02, 2017 7:44 pm

So why not do a search in the source code for any JQuery that selects this button by ID?

paul@ant$ grep -ri "#button-cart"
upload/catalog/view/theme/default/template/product/product.tpl:$('#button-cart').on('click', function() {

And here's your answer:
/catalog/view/theme/default/template/product/product.tpl

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by JonathanR » Fri Mar 03, 2017 1:55 am

Hello Paul,

Thank you for your reply.

I'll keep trying as nothing is working yet, but I am sure it is in there somewhere.

New member

Posts

Joined
Sun Apr 15, 2012 4:34 pm
Who is online

Users browsing this forum: No registered users and 6 guests