
app/design/frontend/default/sunnyD/template/callouts/checkout.phtml file: <div class = "box">
<script src = "https://siteseal.thawte.com/cgi/server/thawte_seal_generator.exe"> </ script>
</ div>
<div class = "box">
<img src = "<? php echo $ this-> getSkinUrl ('images / free-shipping.gif')?>" alt = "<? php echo __ ('Free Shipping')?>" />
</ div> core/template . It is very convenient for displaying simple templates without logic, it needs to pass only one parameter - the template that needs to be output. And, because A simple checkout template consists of content and a right block ( 2columns-right.phtml ), add our new block to the right side of the page, something like this: <code> <checkout_onepage_index>
...
<reference name = "right">
...
<block type = "core / template" name = "images" template = "callouts / checkout.phtml" />
... checkout.phtml template appear on the right.checkout.xml , section checkout_onepage_progress . We need to add our block, as we did in the checkout_onepage_index section. But what is it? Our pictures anyway, no!output parameter to the block and assign the value toHtml : <checkout_onepage_progress>
...
<block type = "core / template" name = "images" output = "toHtml" template = "callouts / checkout.phtml" />
... img tag. The second image loaded via Javascript is not visible. Moreover, although the js code came in response from the server, it disappeared from the DOM tree. Any filter?opcheckout.js file. It seems that the code that updates the right side of the page looks like this: ...
reloadProgressBlock: function () {
var updater = new Ajax.Updater ($$ ('. col-right') [0], this.progressUrl, {method: 'get', onFailure: this.ajaxFailure.bind (this)});
},
... col-right and installs to it the new html received from the server.template/page/2columns-right.phtml : ...
<! - start right ->
<div class = "col-right side-col">
<? php echo $ this-> getChildHtml ('right')?> & nbsp;
</ div>
<! - end right ->
... reference name="right" , or directly into this template, everything will be inside the diva with the class col-right and, as a result, will be erased in the next steps checkout2columns-right.phtml . And in this template somehow put our template with pictures "outside" the right side, so that it would not be erased with new data.2columns-right-checkout.phtml , and specify in checkout.xml what you need to use it. <checkout_onepage_index>
...
<reference name = "root">
<action method = "setTemplate"> <template> page / 2columns-right.phtml </ template> </ action> <checkout_onepage_index>
...
<reference name = "root">
<action method = "setTemplate"> <template> page / 2columns-right-checkout.phtml </ template> </ action> 2columns-right.checkout.phtml in the output part of the right side: <! - start right ->
<div class = "side-col" style = "float: right;">
<div class = "col-right side-col" <? php echo $ this-> getChildHtml ('right')?> </ div>
<div class = "col-right side-col">
<? php echo $ this-> getChildHtml ('images')?>
</ div>
</ div>
<! - end right -> col-right , because then the content of this diva will be lost. But we can leave it with a side-col class (which simply sets the width of the column, now 195px). And we add the float: right property so that our div-wrapper is located on the right.getChildHtml('right') , then our template with pictures getChildHtml('images') .side-col and col-right classes. During the transition between steps, the contents of the first block with the class col-right will be updated, and the second block with our pictures will remain intact throughout the checkout. As required.getChildHtml('images') work out and display our core/template block with a template with images, you need to add it to checkout.xml inside the reference name="root" . And add the property as , equal to images . This images is the name by which getChildHtml() will find our block. We get: <checkout_onepage_index>
...
<reference name = "root">
...
<block type = "core / template" name = "images" as = "images" template = "callouts / checkout.phtml" />
... Source: https://habr.com/ru/post/72493/
All Articles