0

The "Add Quote" button in Magento 2.4 is not opening the quote form, and the console shows the following warning message:

Request to access cookie or storage on <URL> was blocked because it came from a tracker and content blocking is enabled

"Request to access cookie or storage on 'https://googleads.g.doubleclick.net/pagead/viewthroughconversion/....' was blocked because it came from a tracker, and content blocking is enabled."

The HTML code for the button is as follows:

<button type="submit" title="<?= $escaper->escapeHtml($block->getButtonText()) ?>" class="amquote-addto-button action outline<?= /* @noEscape */ $additionalClass ?>" data-amquote-js="addto-button" <?php if ($block->getIsLoggedButton()): ?>data-amquote-logged="logged-button"<?php endif;?> <?php if (!$block->isProductListing()): ?> id="product-addtoquote" <?php endif;?> <?php if ($block->isProductListing()): ?> style="display:none;" <?php endif;?> >
    <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" style="height: 16px; margin-right: 8px; margin-top: 4px; fill: white;">
        <path d="M17 14H19V17H22V19H19V22H17V19H14V17H17V14ZM5 3H19C20.11 3 21 3.89 21 5V12.8C20.39 12.45 19.72 12.2 19 12.08V5H5V19H12.08C12.2 19.72 12.45 20.39 12.8 21H5C3.89 21 3 20.11 3 19V5C3 3.89 3.89 3 5 3ZM7 7H17V9H7V7ZM7 11H17V12.08C16.15 12.22 15.37 12.54 14.68 13H7V11ZM7 15H12V17H7V15Z" fill="#f60"></path>
    </svg>
    <?= $escaper->escapeHtml($block->getButtonText()) ?>
</button>

<script type="text/x-magento-init">
    {
        "[data-amquote-js='addto-button']": {
            "Amasty_RequestQuote/js/product/addtoquote": {
                "addUrl": "<?= $escaper->escapeUrl($block->getAddUrl());?>",
                "isCategoryPage": "<?= /** @noEscape */ $block->isProductListing() ?>",
                "loggedIn": "<?= /** @noEscape */ $block->getLoggedIn() ?>",
                "onInit": function() {
                    console.log('Amasty_RequestQuote module initialized');
                    console.log('addUrl:', this.addUrl);
                    console.log('isCategoryPage:', this.isCategoryPage);
                    console.log('loggedIn:', this.loggedIn);
                }
            }
        }
    }
</script>

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.