layout - Unobtrusively add block in cart -
for module i'm working on, want add block in shopping cart screen, want unobtrusively , i'd place beneath cart content , before other blocks (coupon, shipping estimation, totals, ...).
i've managed unobtrusive part: observer listens controller_action_layout_load_before
, if fullnameaction checkout_cart_index
adds handle of layout update xml file:
observer:
public function showuppergifts($observer) { $fullnameaction = $observer->getevent()->getaction()->getfullactionname(); if ($this->_isenabled && ($fullnameaction == 'checkout_cart_index')) { $layoutupdate = $observer->getevent()->getlayout()->getupdate() ->addhandle('my_special_handle'); } }
and layout file:
<my_special_handle> <reference name="content"> <block type="module/block" name="module_block" template="module/block.phtml"/> </reference> </my_special_handle>
with this, content of phtml file shows up, i'm not able place want.
first try use before="name.of.block"
attribute, doesn't work. if use before="whatever"
goes before inside checkout.cart
block, , if use after="whatever"
goes after everything. in short doesn't take content of before
or after
consideration.
looking @ xml layout files of magento's core modules, realized argument before
, after
appears when blocks placing after or before inside right/left columns. guess it's special columns.
so question is, can specify location of block inside content? , yes, how?
solution load block asynchronously, append div of choice result of ajax call, i'd rather in "normal" way if can.
thanks reading :)
Comments
Post a Comment