me2013 Posted December 18, 2013 Share Posted December 18, 2013 (edited) Dear PS enthusiasts, I have a left column that shows 'newsletter', 'categories', and 'secure seal' blocks. These show on every page except the checkout process (5 step), whereby the former two blocks are removed, to show only the 'secure seal' block. I did this via the "hook exceptions", (from editing the block via the "positions" page in Admin) whereby I selected the places the blocks are to be excluded. However, when the customer chooses to pay by e.g. 'bank wire' or some other module, the full left column blocks appear. I cannot find where to exclude the blocks for these modules. Does anybody know how to do this? I'm thinking it may be a file edit of the module PHP file to add some reference to a hook, but it is beyond my current understanding of code. Thank you, ME2013 Edited December 18, 2013 by me2013 (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted December 18, 2013 Share Posted December 18, 2013 hello it's necessary to modify the module code. there is no other way. take a look, this is an example of bankwire module. open file: modules/bankwire/controllers/front/payment.php there is a code: public function initContent() { $this->display_column_left = false; remove the: $this->display_column_left = false; unfortunately, you have to do for all module controllers (in front directory), and also for all other payment modules. Link to comment Share on other sites More sharing options...
me2013 Posted December 18, 2013 Author Share Posted December 18, 2013 Hello Vekia, Thanks for the reply, I will give that a try now and let you know how it goes. As you are a moderator, I opened another topic earlier on the same subject, so it can be closed now, not sure how to do that myself. It's the only other topic I opened. Thanks, ME2013 Link to comment Share on other sites More sharing options...
me2013 Posted December 18, 2013 Author Share Posted December 18, 2013 hello it's necessary to modify the module code. there is no other way. take a look, this is an example of bankwire module. open file: modules/bankwire/controllers/front/payment.php there is a code: public function initContent() { $this->display_column_left = false; remove the: $this->display_column_left = false; unfortunately, you have to do for all module controllers (in front directory), and also for all other payment modules. Hi Vekia, I tried that but the problem still exists - i.e. all the left colum blocks are shown. I want only one block to be shown. My code was actually 'true', not 'false' to begin with: $this->display_column_left = true; I tried removing it, and also changing it to 'false', but it either made no diffrence or removed the entire left column. Is there anything else I can try? If the module was listed in the ADMIN-POSITIONS-(edit module) EXCEPTIONS page then I could select it for exclusion, is there a way to add to this exclusion list? Best wishes, ME2013 Link to comment Share on other sites More sharing options...
vekia Posted December 18, 2013 Share Posted December 18, 2013 it's because in exceptions you can't define exception to "external" pages (payment module that you use) if I were you i will use if condition in module tpl files {if $smarty.get.controller !='payment' || $smarty.get.controller !='validation'} HERE MODULE TPL CODE {/if} Link to comment Share on other sites More sharing options...
me2013 Posted December 18, 2013 Author Share Posted December 18, 2013 (edited) Thanks again for the reply vekia, I hope you are getting paid for this time. I will check out your modules on the link in your signature. I tried what you wrote about 'if condition' in the payment.tpl for 'bank wire' (/modules/bankwire/views/templates/hook) like this: {if $smarty.get.controller !='payment' || $smarty.get.controller !='validation'} <p class="payment_module"> <a href="{$link->getModuleLink('bankwire', 'payment')|escape:'html'}" title="{l s='Pay by bank wire' mod='bankwire'}"> <img src="{$this_path_bw}bankwire.jpg" alt="{l s='Pay by bank wire' mod='bankwire'}" width="86" height="49"/> {l s='Pay by bank wire (order process will be longer)' mod='bankwire'} </a> </p> {/if} but I have no idea if that's right or even if that's what you meant - my coding skills are not great - hence this is all above my current understanding. It didn't change anything that I could see in the front office. If you have no more time to reply, then just close this topic, I will then make concessions and either remove the whole column or leave all the blocks there. Thanks for your replies and time. Edited December 18, 2013 by me2013 (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted December 19, 2013 Share Posted December 19, 2013 no worries my friend, im here to help you have to use this code in .... modules from left column (modules you want to hide) Link to comment Share on other sites More sharing options...
me2013 Posted December 19, 2013 Author Share Posted December 19, 2013 Like this, e.g. for newsletter block tpl (/themes/mytheme/modules/blocknewsletter/views/templates/hook/blocknewsletter.tpl): {if $smarty.get.controller !='payment' || $smarty.get.controller !='validation'} <div id="newsletter_block_left" class="block"> <div class="title_block">{l s='Newsletter' mod='blocknewsletter'}</div> <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 email address' mod='blocknewsletter'}{/if}" onfocus="javascript:if(this.value=='{l s='Your email address' mod='blocknewsletter' js=1}')this.value='';" onblur="javascript:if(this.value=='')this.value='{l s='Your email address' mod='blocknewsletter' js=1}';" 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--> {/if} This didn't make any change? Link to comment Share on other sites More sharing options...
vekia Posted December 19, 2013 Share Posted December 19, 2013 does this file exist in your theme directory? Link to comment Share on other sites More sharing options...
me2013 Posted December 19, 2013 Author Share Posted December 19, 2013 Yes it does. here: /themes/mytheme/modules/blocknewsletter/views/templates/hook/blocknewsletter.tpl Link to comment Share on other sites More sharing options...
vekia Posted December 19, 2013 Share Posted December 19, 2013 so you have to modify this file, it's due to the overriding feature in prestashop Link to comment Share on other sites More sharing options...
me2013 Posted December 20, 2013 Author Share Posted December 20, 2013 Ok, I modified that file, but to no avail. I think I will have to leave this here, as I don't have any more time to invest in this issue. So, the issue is probably solved, just not for me. I'm sure your code works, I might be missing something, maybe the "smarty" thing needs installed. Anyway, thanks for all your help vekia. Link to comment Share on other sites More sharing options...
vekia Posted December 20, 2013 Share Posted December 20, 2013 if you want, i can inspect everything, but in this case i will need an access to bo and ftp. just let me know Link to comment Share on other sites More sharing options...
Eutanasio Posted July 15, 2015 Share Posted July 15, 2015 Hi, I've tried to do the same for a slideshow module that is appearing in (/module/cashondelivery/validation & /module/bankwire/payment) despite I've configured it to only appear in the Index page, but this code doesn't seem to work on PS 1.6. Any help? Thanks! Link to comment Share on other sites More sharing options...
vekia Posted July 16, 2015 Share Posted July 16, 2015 what theme you use? Link to comment Share on other sites More sharing options...
Eutanasio Posted July 16, 2015 Share Posted July 16, 2015 default bootstrap PS 1.6. Thanks! Link to comment Share on other sites More sharing options...
vekia Posted July 17, 2015 Share Posted July 17, 2015 try to go to themes > advanced settings please verify if you've got payment modules on list where you can activate / deactivate columns Link to comment Share on other sites More sharing options...
Eutanasio Posted July 17, 2015 Share Posted July 17, 2015 No @Vekia, I don't have those modules in there. But that was not the question, I wasn't clear enough sorry. What I have is a module "Accordionslider" that I configured to appear only in Index page at the DisplayTop Hook. This is respected for all pages of the website, but not for the payment process (/module/cashondelivery/validation & /module/bankwire/payment). How can I comment this module tpl file to not appear during the payment process for bankwire and COD modules? Thanks! 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