-
Notifications
You must be signed in to change notification settings - Fork 52
Open
Labels
Description
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>