Krapoutchniek Posted April 16, 2015 Share Posted April 16, 2015 (edited) Hi, My problem is simple : I want to link postcodes and the number of products to the carriers. I've looked for a free module to do this but I didn't find anything. Then I included the postcodes in the code : {if ($key == 18 && ($cart_qties < 12 || !in_array($address_list[0].postcode, $codes_postaux_gratuits)) || ($key == 23 && ($cart_qties >= 12 || !in_array($address_list[0].postcode, $codes_postaux_gratuits))))} {$flag = 0} {else} {$flag = 1} {/if} {if $flag == 1} // Display But I hate to do this and when I update the carrier, a new one is created in DB instead of editinig the existing one. So the ID I use in the code is not good anymore... How can I disable this ? Or better : is there a free module that adds postcodes to a carrier ? Thanks. Edited April 16, 2015 by Krapoutchniek (see edit history) Link to comment Share on other sites More sharing options...
Krapoutchniek Posted April 16, 2015 Author Share Posted April 16, 2015 (edited) I just found something : there is an id_reference for the carriers. It is duplicated from id_carrier when we add a new one and it doesn't change when we update a carrier. So I can use it to do the trick (but I still hate this). But there is something wrong. I'm not that used with smarty and I'm just trying to show this id_reference : {foreach $option_list as $key => $option} {$flag = 1} {$option.carrier_list.$key.instance->id_reference} It doesn't work. Nothing is shown. But if I replace key by 17 (the id of the first carrier), the id_reference is shown. I tried all syntaxes but nothing happens... And when I want to show $key, it shows me the current ID. Edited April 16, 2015 by Krapoutchniek (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