soeoneday Posted December 29, 2012 Share Posted December 29, 2012 Dear Moderator, Bagaimana memindahkan block newsletter ke footer. thank's Link to comment Share on other sites More sharing options...
gonebdg - webindoshop.com Posted December 29, 2012 Share Posted December 29, 2012 Saya anggap Prestashop anda v.1.5.2.0 Silahkan lakukan hal berikut ini Modifikasi core file module blocknewsletter.php tambahkan scrip berikut di baris paling bawah public function hookFooter($params) { $this->_prepareHook($params); return $this->display(__FILE__, 'footer_blocknewsletter.tpl'); } Lalu buat file baru bernama footer_blocknewsletter.tpl dan tempatkan dalam sub.directory/folder ..\views\templates\hook\ (agar tidak menggangu file default blocknewsletter.tpl) file baru ini berisikan script smarty sbb : <!-- Block Newsletter module--> <div id="newsletter_block_foot" class="block"> <h4>{l s='Newsletter' mod='blocknewsletter'}</h4> <div class="block_content"> {if isset($msg) && $msg} <p class="{if $nw_error}warning_inline{else}success_inline{/if}">{$msg}</p> {/if} <form action="{$link->getPageLink('index')}" method="post"> <p> {* @todo use jquery (focusin, focusout) instead of onblur and onfocus *} <input type="text" name="email" size="18" value="{if isset($value) && $value}{$value}{else}{l s='your e-mail' mod='blocknewsletter'}{/if}" onfocus="javascript:if(this.value=='{l s='your e-mail' mod='blocknewsletter'}')this.value='';" onblur="javascript:if(this.value=='')this.value='{l s='your e-mail' mod='blocknewsletter'}';" class="inputNew" /> <!--<select name="action"> <option value="0"{if isset($action) && $action == 0} selected="selected"{/if}>{l s='Subscribe' mod='blocknewsletter'}</option> <option value="1"{if isset($action) && $action == 1} selected="selected"{/if}>{l s='Unsubscribe' mod='blocknewsletter'}</option> </select>--> <input type="submit" value="ok" class="button_mini" name="submitNewsletter" /> <input type="hidden" name="action" value="0" /> </p> </form> </div> </div> <!-- /Block Newsletter module--> Kemudian sesuaikan desainnya dengan merubah file blocknewsletter.css untuk div id="newsletter_block_foot" dalam file css diawali #newsletter_block_foot JANGAN LUPA untuk mengkaitkan module ini ke footer Back Office > Modules > Positions : Transplant a module Selamat berkreasi ... Link to comment Share on other sites More sharing options...
soeoneday Posted January 5, 2013 Author Share Posted January 5, 2013 Saya sudah mencobanya tapi error, apakah karena saya salah mengetik kode seperti yang tampak pada file yang saya kirim. Mohon sarannya BlockNewsLetter.zipFetching info... Link to comment Share on other sites More sharing options...
gonebdg - webindoshop.com Posted January 5, 2013 Share Posted January 5, 2013 Anda salah menempatkan script public function hookFooter($params) Tempatkan dibawah public function hookDisplayHeader($params) , namun masih dalam class Blocknewsletter extends Module Silahkkan periksa lagi, perhatikan tanda kurung kuwara } Nantinya jadi seperti ini : class Blocknewsletter extends Module { ................................................. ..... BARIS SEBELUMNYA ........ ................................................. public function hookDisplayHeader($params) { $this->context->controller->addCSS($this->_path.'blocknewsletter.css', 'all'); } public function hookFooter($params) { $this->_prepareHook($params); return $this->display(__FILE__, 'footer_blocknewsletter.tpl'); } } Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now