Jump to content

Carriers and postcodes


Krapoutchniek
 Share

Recommended Posts

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 by Krapoutchniek (see edit history)

Share this post


Link to post
Share on other sites

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 by Krapoutchniek (see edit history)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More