HEX
Server: LiteSpeed
System: Linux standart9.isimtescil.net 3.10.0-962.3.2.lve1.5.26.7.el7.x86_64 #1 SMP Wed Oct 2 07:53:12 EDT 2019 x86_64
User: karalev (5310)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: //home/karalev/www/wp-content/plugins/woocommerce/assets/js/frontend/wp-consent-api-integration.js
( function () {
	'use strict';

	// Set order attribution on consent change.
	document.addEventListener( 'wp_listen_for_consent_change', ( e ) => {
		const changedConsentCategory = e.detail;
		for ( const key in changedConsentCategory ) {
			if ( changedConsentCategory.hasOwnProperty( key ) && key === window.wc_order_attribution.params.consentCategory ) {
				window.wc_order_attribution.setOrderTracking( changedConsentCategory[ key ] === 'allow' );
		}
		}
	} );

	// Set order attribution as soon as consent type is defined.
	document.addEventListener( 'wp_consent_type_defined', () => {
		window.wc_order_attribution.setOrderTracking( wp_has_consent( window.wc_order_attribution.params.consentCategory ) );
	} );
}() );