Skip to content

IMPORTANT: please add support for onepage checkout tracking #14

@phildpearce

Description

@phildpearce

This is a very important feature request.

Adding this via customHTML breaks functionality, thus please add as an inline code to replicate the native Magento functionality for onclick events within the accordion.

<script type="text/javascript">
//<![CDATA[
    var accordion = new Accordion('checkoutSteps', '.step-title', true);
            accordion.openSection('opc-login');
            var checkout = new Checkout(accordion,{
        progress: 'https://www.supersup.com/checkout/onepage/progress/',
        review: 'https://www.supersup.com/checkout/onepage/review/',
        saveMethod: 'https://www.supersup.com/checkout/onepage/saveMethod/',
        failure: 'http://www.supersup.com/checkout/cart/'}
    );
    checkout.accordion.originalOpenSection = checkout.accordion.openSection;
    checkout.accordion.openSection = function(section) {
        var currentSection = this.currentSection;
        var section = $(section);
        this.originalOpenSection(section);
        if (Element.hasClassName(section, 'allow') && section.id != currentSection) {
            var checkoutStepId =  section.readAttribute('id').replace('opc-', '');

                            // GTM trackPageview for checkout steps
            dataLayer.push({'event':'onclick_trackPageview', 'page_virtual':'/checkout/onepage/' + checkoutStepId});

        }
    };
//]]>
</script>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions