Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

window.checkout is undefined if minicart is removed #1458

Closed
Zaylril opened this issue Jul 8, 2015 · 10 comments
Closed

window.checkout is undefined if minicart is removed #1458

Zaylril opened this issue Jul 8, 2015 · 10 comments
Labels
bug report Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development

Comments

@Zaylril
Copy link

Zaylril commented Jul 8, 2015

Hey,

When building the cart/checkout page on my current theme, i've removed the minicart from the cart page in the header. However this results in me now getting an error when clicking proceed to checkout as the checkoutUrl is undefined in the window.checkout object.

You should be able to proceed to the checkout without having the minicart available on the page (I've just had to hide it for now with css rather than remove).

Thanks

@vpelipenko vpelipenko added CS bug report Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development labels Jul 8, 2015
@vpelipenko
Copy link
Contributor

Internal ticket: MAGETWO-39865

@vpelipenko
Copy link
Contributor

@Zaylril, internal ticket is fixed and already available in develop branch. Please, check the fix, if something doesn't work for you, feel free to reopen this issue.

@weilunallen
Copy link

In 2.0.6, this problem still persist, I can't use search's autocomplete, if mini-cart is not on the page, due to window.checkout.autocomplete is undefined.

@Galch24
Copy link

Galch24 commented Aug 24, 2016

In 2.1.0, this problem still persist. If I hided minicart in header (in default.xml layout) the similar errors are showed in console:

TypeError: window[this.configSource] is undefined
captchaConfig = window[this.configSource]['captcha'];

in defaultCaptcha.js (line 29, col 17)

@TClilMouse
Copy link

In 2.1.1, this problem still persist.

@markdavies
Copy link

window.checkout.autocomplete is undefined if you remove the minicart... still

@designbyadrian
Copy link

Does anyone know what the minimum amount of blocks you need to add to make this work?

@simonrl
Copy link

simonrl commented Nov 15, 2016

I worked around this by not removing the minicart block in the layout, but overriding the template file Magento_Checkout/templates/cart/minicart.phtml; the contents of the new file:

<script>
    window.checkout = <?php /* @escapeNotVerified */ echo \Zend_Json::encode($block->getConfig()); ?>;
</script>

@rodchencko
Copy link

2.1.1 here and the problem still persists. Has anybody discovered a workaround for this?

@pravalitera
Copy link

I had to solve it quickly yesterday. Put it in the layout you need :

<referenceContainer name="after.body.start">
            <block class="Magento\Framework\View\Element\Text" name="fixminicarterror">
                <arguments>
                    <argument name="text" xsi:type="string"><![CDATA[<script>window.checkout = {};</script>]]></argument>
                </arguments>
            </block>
        </referenceContainer>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development
Projects
None yet
Development

No branches or pull requests

10 participants