drasl Posted June 24, 2016 Share Posted June 24, 2016 Like the title says... I wan't to except the COD payment method for a single carrier. I just add this if in modules/codfee/views/templates/hook/payment.tpl : {if (context::getContext()->cart->id_carrier != 133 )} <div class="capa_codfee col-xs-12 col-md-6"> <p class="payment_module"> <a class="codfee" href="{$link->getModuleLink('codfee', 'validation', [], true)}" title="{l s='Cash on delivery (COD)' mod='codfee'}"> {l s='Cash on delivery (COD) : you pay for the merchandise upon delivery' mod='codfee'} <span>{l s='Aditional cost: ' mod='codfee'}<strong>{convertPrice price=$fee}</strong></span> </a> </p> </div> {/if} I thought it was working, but nop. It's works when I change between not free carriers, but when O change to a free shipping carrier, the {$HOOK_PAYMENT} won't update, it's only update via ajax when you change the radio option between not free carriers... Do you guys have some idea about it? Link to comment Share on other sites More sharing options...
shokinro Posted June 25, 2016 Share Posted June 25, 2016 Please note - the id_carrier changes when someone edit and save the carrier. The old one will be set as deleted in database (still exists, but marked as deleted) Link to comment Share on other sites More sharing options...
drasl Posted June 25, 2016 Author Share Posted June 25, 2016 (edited) Thanks, then I will get the name instead of the ID if possible. Anyways, it's not the problem, the code is working, but only when the carrier is not free. Strange. Edited June 25, 2016 by lsard (see edit history) Link to comment Share on other sites More sharing options...
shokinro Posted June 25, 2016 Share Posted June 25, 2016 you may need to modify the codfee module to check if the carrier is free shipping or not and than pass it as Smarty parameter for example $isfreeshipping to use it at your theme file. Link to comment Share on other sites More sharing options...
drasl Posted June 26, 2016 Author Share Posted June 26, 2016 (edited) It won't work, the problem is when i switch between radio buttons section only with free carriers, ajax won't update the codfee tpl. Edited June 26, 2016 by lsard (see edit history) Link to comment Share on other sites More sharing options...
shokinro Posted June 26, 2016 Share Posted June 26, 2016 I won't work, the problem is when i switch between radio buttons free carriers, ajax won't update the codfee tpl. it might be not that easy, but there should be a way for you to pass back the carrier selection info and free shipping or not via ajax call. maybe you can try to contact the developer of the module for help. Link to comment Share on other sites More sharing options...
drasl Posted June 26, 2016 Author Share Posted June 26, 2016 (edited) But is not about the module , it's about the ajax file or the controller that it calls, but there is a lot of code not easy to understand. Edited June 26, 2016 by lsard (see edit history) 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