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

Checkout Progress: Explicit Steps Needed #877

Closed
wants to merge 1 commit into from

Conversation

astorm
Copy link
Contributor

@astorm astorm commented Aug 5, 2015

I was doing some varnish troubleshooting for a client, and we ran into a situation, using Magento 1.9.0.1, where the cart checkout progress blocks were not bypassing the varnish cache. We solved this by adding checkout to the turpentine blacklist -- but after investigating a bit I discovered the the approach turpentine takes to exclude checkout progress needs some tweaking. This pull request is lightly tested -- so consider this more a bug report than anything else.

Also, seems related to @craigcarnell's problems in this ticket
#455

The basic problem is the progressAction method doesn't do a full layout load (loadLayout)

#File: app/code/local/Mage/Checkout/controllers/OnepageController.php
public function progressAction()
{
    // previous step should never be null. We always start with billing and go forward
    $prevStep = $this->getRequest()->getParam('prevStep', false);

    if ($this->_expireAjax() || !$prevStep) {
        return null;
    }

    $layout = $this->getLayout();
    $update = $layout->getUpdate();
    /* Load the block belonging to the current step*/
    $update->load('checkout_onepage_progress_' . $prevStep);
    $layout->generateXml();
    $layout->generateBlocks();
    $output = $layout->getOutput();
    $this->getResponse()->setBody($output);

    return $output;
}

Instead, it specifically loads only the progress handle it needs

$prevStep = $this->getRequest()->getParam('prevStep', false);
//...
$update->load('checkout_onepage_progress_' . $prevStep);

Since loadLayout is never called, the checkout_onepage_progress handle(s) are never loaded into the layout and can't be applied. This includes the all important handle in turpentine_esi.xml

#File: app/design/frontend/base/default/layout/turpentine_esi.xml
<checkout_onepage_progress>
    <turpentine_cache_flag value="0"/>
</checkout_onepage_progress>

This pull request attempts a crude fix by being explicit about the progress handles to exclude. Another approach might be a pre-action dispatch listener that manually loads the checkout_onepage_progress handle in the layout -- I'm never sure how fancy to get in other people's projects :)

@miguelbalparda
Copy link
Contributor

Thank you for the contribution @astorm, would you mind changing the branch target to devel instead of master?

@astorm
Copy link
Contributor Author

astorm commented Aug 6, 2015

Herp Derp, your strange modern ways frighten and confuse this frozen caveman developer. Closing this request, new request to devel here: #878

@astorm astorm closed this Aug 6, 2015
@miguelbalparda
Copy link
Contributor

Perfect, thank you! We will review it and merge it as soon as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants