Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9256495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:57:22+00:00 2026-06-18T11:57:22+00:00

so this is a follow up question of this one . I am adding

  • 0

so this is a follow up question of this one.
I am adding a step before the shipping-methods by observer. I have a problem for getting the html used to update the step’s tab content. Despite my best efforts it still loads the html of the shipping-method step instead of the html I want.
This is the code of the observer:

public function gotoViesStep($observer)
{
    $response = $observer->getEvent()->getControllerAction()->getResponse();
    $body = $response->getBody();
    $result = Mage::helper('core')->jsonDecode($body);

    if (in_array('error', $result)) {
        return;
    }

    //if conditions are met, go to vies check
    if ($result['goto_section'] == 'shipping_method') {
        $quote = Mage::getSingleton('checkout/session')->getQuote();
        $shippingAddress = $quote->getShippingAddress();
        $countryId = $shippingAddress->getCountryId();

        if (($countryId != 'BE') && ($this->_countryInEU($countryId))) {
            $result['goto_section'] = 'vies';
            $result['allow_sections'][] = 'vies';
            $result['country_id'] = $countryId;

            $result['update_section'] = array(
                    'name' => 'vies',
                    'html' => $this->_getViesHtml()
                );

            $response->setBody(Mage::helper('core')->jsonEncode($result));
        }
    }
}

protected function _getViesHtml()
{
    $layout = Mage::getSingleton('core/layout');
    $update = $layout->getUpdate();
    $update->load('checkout_onepage_vies');
    $layout->generateXml();
    $layout->generateBlocks();
    $output = $layout->getOutput();
    return $output;
}

and the layout.xml of that handle checkout_onepage_vies:

<checkout_onepage_vies>
    <remove name="right"/>
    <remove name="left"/>

    <block type="correctionvat/onepage_vies" name="root" output="toHtml" template="correctionvat/onepage/vies.phtml"/>
</checkout_onepage_vies>

If I put something directly instead of trying to load the block, it works. I.E., if, instead of 'html' => $this->_getViesHtml() I do 'html' => 'foobar', the content of the step is foobar.

So it’s like as the output/layout/blocks is already charged by the OnepageController my attempt to re-charge it again fails.
Any thaughts?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T11:57:23+00:00Added an answer on June 18, 2026 at 11:57 am

    The problem you are facing is related to the list of added layout handles. You need to reset them before calling load() method. Also you need to reset updates array, that contain previously parsed xml by calling resetUpdates() method.

    You getViesHtml() should look like the following in the end:

    protected function _getViesHtml()
    {
        $layout = Mage::getSingleton('core/layout');
    
        $layout->getUpdate()
             ->resetHandles()
             ->resetUpdates()
             ->load('checkout_onepage_vies');
    
        $layout->generateXml()
             ->generateBlocks();
    
        $output = $layout->getOutput();
        return $output;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a follow-up question to this one . I created a new form,
I have a follow up question to this one . Now that I have
This is a follow-on question from the one I asked here . Can constraints
This is a follow-up question to this one . Consider this example: #include <iostream>
This is like a follow-up question to this one . Basically what I'm doing
Just a follow up question to this one here => link Is it possible
This is really a follow on question to a previous one , where I
This question is a follow on from this one ... I am binding to
This is a follow up question to this one: Syntax confusion (do block) So,
This is a follow-up question to Merging multiple encoded polylines into one encoded polyline

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.