이므로 one의 후속 질문입니다.
관찰자가 배송 방법을 시작하기 전에 단계를 추가하고 있습니다. 단계의 탭 내용을 업데이트하는 데 사용되는 html을 얻는 데 문제가 있습니다. 최선의 노력에도 불구하고 원하는 html 대신 배송 방법 단계의 html을로드합니다. checkout_onepage_vies
을 처리오버라이드없이 OPC에 단계를 추가하십시오. 업데이트 섹션
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;
}
그의 layout.xml :
이것은 관찰자의 코드
<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>
나는 블록을로드하는 대신 직접 뭔가를 넣어 경우 작동합니다. I.E. 'html' => $this->_getViesHtml()
대신 'html' => 'foobar'
을 사용하는 경우, 단계의 내용은 foobar
입니다.
출력/레이아웃/블록이 OnepageController에 의해 이미 청구되었으므로 다시 충전하는 시도가 실패합니다.
뭐니 뭐니?
고맙습니다 이반을 다시 한 번 나는 그것을 시도했지만이 일을하지 않았다 :-). 난 그냥 깨끗한 설치를 시도하고 작동합니다 : 다른 방법은 그때, 난 사용자 정의 모듈을 파고해야합니다. – OSdave