Jump to content

Undefined variable: id_currency in Carrier.php


Recommended Posts

Hello,

 

I get this notice at the top of my page when creating an account on my shop faubourges.fr:

Notice: Undefined variable: id_currency in /homepages/30/d646934256/htdocs/classes/Carrier.php on line 652

This message does not appear all the time and I could only see it on Firefox (latest version).

Iam not a developer an I am a little bit lost. I checked th line of code from the page Carrier.php on my FTP, and here is what it shows:

 

                    if ($shipping_method == Carrier::SHIPPING_METHOD_PRICE
                        && (!Carrier::checkDeliveryPriceByPrice($row['id_carrier'], $cart->getOrderTotal(true, Cart::BOTH_WITHOUT_SHIPPING), $id_zone, $id_currency))) {
                        $error[$carrier->id] = Carrier::SHIPPING_PRICE_EXCEPTION;
                        unset($result[$k]);
                        continue;
                    }

 

If someone can help me with this, I would be grateful. I am just starting my business, and it is a pain to see that my first clients can be blocked at this step.

Thanks for your help.

 

Ben

Link to comment
Share on other sites

I wanted to know the PS version so I could review the code of the Carrier class.  This class has not really changed much at all in the past couple of versions, and I have not received this error before.

 

So I suspect there is either a custom module installed with your theme that is causing the issue.

 

You might reach out to the theme author to report the issue and see what type of support they will offer you

Link to comment
Share on other sites

Hi,

Thanls for your help and wise return.

I think I have found the origin of the problem. This was due to an update of my FTP files, where a perturbating directory was left : the .op_cache.

I deleted it and hope there will be no more conflict now on my shop.

Thank you again for the support.

Cheers

Link to comment
Share on other sites

Hello Dams59,

 

First, I checked all the delivery options for each of the products of my store.

They were not all set up correctly, as I made some changes in delivery options and did not update the corresponding options in my product pages.

 

But this was not my only mistake, so if it still does not work, you probably should look at the operations you made on your server. Did you do an upgrade or update ? Onmy side, I had to re-load my full site, but I did not remove the .opcache file, which I should have done.

And last, I had a bug coming from my Mailchimp plugin. A freelance developer identified it and simply de-activated this module.

Now my website works fine, but the Mailchimp automatic synchronisation is not running.

Good luck with your problem.

What is the url of your website ?

 

Cheers

Link to comment
Share on other sites

Hello,

 

I suddenly have exactly the same issue this morning, i also update this week to 1.6.1.14, my theme is default customized

 

My front office display Fatal error and

Notice: Undefined variable: id_currency in /senteurs-et-couleurs-du-souk/boutique/classes/Carrier.php on line 652

 

But my back office is working fine and this trouble is only with firefox...

 

i disconnect my mailchimp, uninstall the rewards module i was using when this error appears, but unsuccesfull to solve it

 

Otherwise my website works fine on Chrome, Opera, Safari, Edge...

 

Last days i set up PHP 7.0 on my server, and made some changes about cache but the site was still working last 3 days, and at this time i don't have acces to my cpanel... it seem there is trouble on provider side

 

Any idea welcome, thanks

 

Christophe

Edited by crisarno (see edit history)
Link to comment
Share on other sites

  • 2 years later...

Hello, I had the same problem here and it turned out prestashop did not like the :

"Out Ranges > disable the carrier" (comportement hors-tranche > désactiver le transporteur). Not sure the translation is right ;) 

When turning in to "choose the biggest range" it works perfectly.


Thanks all for your help !

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