Jump to content

Please, How To Disable Zip Code In Shipping Estimation Module ?


Recommended Posts

Hello,

 

I am new to prestashop, and I have put the shipping estimation 1.1 module that comes with Prestashop 1.4.5. I have searched in the forums for this but have not found yet a solution that works for this.

 

Please, I want to know if it possible in some way to modify the carriercompare.php or carriercompare.tpl to disable the zip code in the shipping estimation.

 

I have already deleted the zip code related parts on both files, and then the zip code is not shown on the shipping estimator, BUT it is still asking for a zip code when clicking refresh !!!

 

I have configured 2 carriers, and configured the countries and states, and the shipping prices by weight.

 

When going to the cart summary, it appears the shipping estimator and you can choose the country and the state to calculate the shipping rate and it appears right, BUT you can´t click on the refresh button because it appears the following messsage

 

Please use a valid zip/postal code depending on your country selection

 

Why must I add a zip code to calculate the shipping rate if it is already configured inside Prestashop shipping options ?

 

I am NOT using UPS, Fedex, DHL, or any other similar carrier, I am using a local domestic transport company and the Spanish Post Office service that does not have a specific module for prestashop.

 

In the zip code area puts "

(Needed for certain carriers)", well if this is true WHY is needed the zip code in ALL the carriers even if it is not needed? I mean that I always get the above error asking always for zip code.

I want that the Zip Code ONLY appears and is requested only at checkout and with the destination adress.

 

Thanks very much for your help

Link to comment
Share on other sites

Hello, Dave L,

 

Thanks very much for your suggestion

 

I have already tried this, and have already configured, as you said, some countries and have set the "need zip code" to NO, but regretably the shipping KEEPS asking for a zip code EVEN when I have already in countries configuration that is NOT needed.

 

WHY keeps asking for it when I have put as you said that it should NOT be requiered ? :blink::wacko:

 

And what it even worse, now if I put the right and valid zip code in the shipping estimator to the countries that still are configured to requiere zip code, IT DOES NOT WORK !! and still keeps asking for a "valid" zip code, and is impossible, because here where I live the zip code is 29630, and Prestashop tells me that this is wrong ? I have configured it correctly to ask only for numbers and no letters, and still does not work :wacko::huh:

Link to comment
Share on other sites

  • 2 weeks later...

I have the same problem with the module. I'm running PrestaShop™ 1.4.6.2 using ONLY Spanish for the Store Front.

 

Surprinsingly, when I add a product to the cart the module shows correctly the Country (Venezuela) and gives me the "Please use a valid zip/postal code depending on your country selection" error.

 

If I use the selection box to choose ANY other country, as a result Prestashop shows me the correct info (2 carriers in my case). But If I select again the only valid country for my shop (Venezuela), then the error shows up again!

 

:-(

Link to comment
Share on other sites

Hello dnaranjor, thanks very much for your information, and to let me know that you have the same problem than me.

 

One question I want to make you, How many carriers do you have? Just one, or more than one ?

I have just updated to version 1.4.6.2 to see if with this the carriercompare module would be updated to and work as it should, BUT regretably it keeps always asking for ZIP code and gives me the "Please use a valid zip/postal code depending on your country selection" error, EVEN when the zipcode is entered and is right.

 

In the shipping estimator works well UNTIL you have to CHOOSE a carrier and click on the refresh button, and so it always gives me error telling that I can´t refresh because the ZIP code is wrong.

 

I tried it in the Presatashop demo and it works right, BUT because it has only ONE carrier, it seems that if you have MORE THAN ONE carrier there are problems !!

Link to comment
Share on other sites

 

Indeed, I have 2 different carriers!!!

 

Yes, if you have more than one carrier, then the choice activator is enabled and then you can´t make a choice unless you enter the zip code.

 

I have tried to configure MY OWN country that is selected as default in the Prestashop preferences, and have configured it with NNNNN, and now it works and does not give me the ZIP code error, BUT any way I do not want that the shipping estimator NEEDS to have the zip code to be able to choose the carrier you want.

 

SO I am still looking for a way for disabling the zip code in the shipping estimator

 

dnaranjor, have you configured you own country that you have set by default with the right zip code configuration ?

Link to comment
Share on other sites

I really do not know why the zip code is not OPTIONAL, and something that could be turn off if is not needed for a shipping estimator that does NOT use any automatic shipping rates carrier. I know that a zipcode is needed for UPS, Fedex, or similar that get the rates from their own website, BUT why is needed the zip code for your own already configured shipping rates ?

 

I have found another free Shipping Calculator that works very well WITHOUT any ZIP code, the problem is that if you have more than 1 carrier YOU CAN´T choose which carrier you want as it happens with the prestashop module.

Link to comment
Share on other sites

  • 2 months later...

I have also had this problem but think I've solved it! I deleted the "if (!$this->checkZipcode..." command on (about) lines 193/194 of the carriercompare.php file in the module of that name.

 

It certainly seems to work, both on my test rig and the live site - one has 2 carriers, the other has 3 carriers. I've configured the shipping rates for each and being domestic (UK Royal Mail) do not need zip codes / post codes.

  • Like 1
Link to comment
Share on other sites

  • 1 year later...

Thanks King Alfred for a hint. I managed to remove the ZIP code, too. For those who still struggle with that I'm including detailed instructions:

 

Open carriercompare.php (you'll find it in modules - carriercompare). Find this code...

 

if (!$this->checkZipcode($zipcode, $id_country))  
  $errors[] = $this->l('Depending on your country selection, please use a valid zip/postal code.');

 

... and uncomment it with /* */. You will get this:

 

/*  if (!$this->checkZipcode($zipcode, $id_country))  
  $errors[] = $this->l('Depending on your country selection, please use a valid zip/postal code.');	*/

 

Now your customers do not need to enter ZIP code. But the ZIP form is still there. So, if you want to remove it, open carriercompare.tpl (you'll find it in modules - carriercompare - template) and find this code...

 

<p>
  <label for="zipcode">{l s='Zip Code' mod='carriercompare'}</label>
  <input type="text" name="zipcode" id="zipcode" value="{$zipcode|escape:'htmlall':'UTF-8'}"/> ({l s='Needed for certain carriers.' mod='carriercompare'})  
 </p>

 

Uncomment it with {* *} . You'll get this:

 

{* <p>
  <label for="zipcode">{l s='Zip Code' mod='carriercompare'}</label>
  <input type="text" name="zipcode" id="zipcode" value="{$zipcode|escape:'htmlall':'UTF-8'}"/> ({l s='Needed for certain carriers.' mod='carriercompare'})  
 </p> *}

 

That's it. Now ZIP code field does not show.

 

Hope this helps.

 

PS: I'm using Prestashop 1.5.4.0 and Shipping Estimation module that is already built in (version 1.2).

Edited by mouse1 (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 7 months later...

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
×
×
  • Create New...