grovers Posted January 19, 2021 Share Posted January 19, 2021 (edited) Hi. Would really appreciate some advice please: I have a multistore (2). One shop checkout works with shipping method the other displays: "Unfortunately, there are no carriers available for your delivery address." I can not see any difference between the two stores settings in shipping/carriers-preferences or International/zone-country-states grovers.biz is ok - grovers.biz/toys is not I have seen other threads but not with a single store in multistore.... Thank you Edited January 19, 2021 by grovers (see edit history) Link to comment Share on other sites More sharing options...
Prestachamps Posted January 19, 2021 Share Posted January 19, 2021 Hi, for this fix you can create an override for the Cart.php class and add this inside the override file in /override/class/Cart.php: <?php use PrestaShop\PrestaShop\Adapter\ServiceLocator; class Cart extends CartCore { /** BEGIN PrestaChamps Override fix Unfortunately, there are no carriers available for your delivery address **/ public function updateAddressId($id_address, $id_address_new) { $to_update = false; if (!isset($this->id_address_invoice) || $this->id_address_invoice == $id_address) { $to_update = true; $this->id_address_invoice = $id_address_new; } if (!isset($this->id_address_delivery) || $this->id_address_delivery == $id_address) { $to_update = true; $this->id_address_delivery = $id_address_new; } if ($to_update) { $this->update(); } $sql = 'UPDATE `' . _DB_PREFIX_ . 'cart_product` SET `id_address_delivery` = ' . (int) $id_address_new . ' WHERE `id_cart` = ' . (int) $this->id // . ' AND `id_address_delivery` = ' . (int) $id_address ; Db::getInstance()->execute($sql); $sql = 'UPDATE `' . _DB_PREFIX_ . 'customization` SET `id_address_delivery` = ' . (int) $id_address_new . ' WHERE `id_cart` = ' . (int) $this->id // . ' AND `id_address_delivery` = ' . (int) $id_address ; Db::getInstance()->execute($sql); } /** END PrestaChamps Override fix Unfortunately, there are no carriers available for your delivery address **/ } Kind regards, Leo. Link to comment Share on other sites More sharing options...
grovers Posted January 19, 2021 Author Share Posted January 19, 2021 (edited) Hi Leo Thank you for the reply Is this the right place?: /override/classes/Cart.php (not class) Does it simply go at the very top? Can you help me understand why it has happened? Thank you Edited January 19, 2021 by grovers (see edit history) Link to comment Share on other sites More sharing options...
Prestachamps Posted January 19, 2021 Share Posted January 19, 2021 (edited) Hi, yes, it's the /httpdocs/override/classes/Cart.php this is a bug of Prestashop. Kind regards, Leo. Edited January 19, 2021 by Prestachamps (see edit history) Link to comment Share on other sites More sharing options...
grovers Posted January 19, 2021 Author Share Posted January 19, 2021 (edited) Hi Leo copied into page & I got white pages on the front & a 500 error on back office. I have you some screen shots if that helps? #3 is Cart.php before pasting Edited January 19, 2021 by grovers (see edit history) Link to comment Share on other sites More sharing options...
Prestachamps Posted January 22, 2021 Share Posted January 22, 2021 Hi, you cannot open twitce the <?php , and as I see, you already have this override, so in this case you need to add only the function inside the class, I mean to add it at the end of the file, but inside the {} of the main class <?php /** ..................... **/ class Cart extends CartCore { ....... /** The current content of class (except the ending } of the class /** HERE ADD MY **/ public function updateAddressId(){ ..... } /** JUST fBEFORE THE ENDNG } of the class **/ } Or just attach your existing Cart override file and I will add the function then re-send it to you back. Kind regards, Leo Link to comment Share on other sites More sharing options...
grovers Posted January 22, 2021 Author Share Posted January 22, 2021 Thank you Leo. It is very much appreciated (attached) Cart.php Link to comment Share on other sites More sharing options...
Prestachamps Posted January 22, 2021 Share Posted January 22, 2021 Hi, here is the override with the fix in it. Cart.php Kind regards, Leo Link to comment Share on other sites More sharing options...
grovers Posted January 22, 2021 Author Share Posted January 22, 2021 Hi Leo Sorry but, that does not alter the error (checkout still works in our other store). I am attaching the cPanel screenshote for you & I have clear/turn off all cache. Any ideas please? Thanks Link to comment Share on other sites More sharing options...
grovers Posted February 5, 2021 Author Share Posted February 5, 2021 If anyone can help me with this please? Link to comment Share on other sites More sharing options...
grovers Posted February 7, 2021 Author Share Posted February 7, 2021 I am guessing that /override/classes/Cart.php is not the problem When I disable the module "bvkpaymentfees" it does not alter the error "Unfortunately, there are no carriers available for your delivery address" is the same & only in one store! I have tried altering country/zones/enable/disable/clear cache/disable non ps modules in that store - no change Link to comment Share on other sites More sharing options...
Constantino Posted February 10, 2021 Share Posted February 10, 2021 On 1/19/2021 at 11:52 AM, grovers said: Hi. Would really appreciate some advice please: I have a multistore (2). One shop checkout works with shipping method the other displays: "Unfortunately, there are no carriers available for your delivery address." I can not see any difference between the two stores settings in shipping/carriers-preferences or International/zone-country-states grovers.biz is ok - grovers.biz/toys is not I have seen other threads but not with a single store in multistore.... Thank you So, 1) carrier is active 2) the necessary carrier's countries are enabled for its zone in Localization->Countries menu 3) the carrier is allowed for customer group 4) weight and price ranges are specified 5) package dimensions aren't out of range, correct? Link to comment Share on other sites More sharing options...
grovers Posted February 10, 2021 Author Share Posted February 10, 2021 Thanks for the help: It is a multistore & the other shop works. I believe that rules out 1, 3,4 & 5 as the setting is common to both stores. The answer to 2 is yes as per the screenshots. Very greteful for more suggestions Link to comment Share on other sites More sharing options...
yarik121 Posted November 22, 2021 Share Posted November 22, 2021 I have the same problem in Prestashop 1.7.7.3 Unfortunately, there are no carriers available for your delivery address But the funny thing is that carriers show up in the desktop version and on the mobile phone it's giving this error which lead me to a conclusion that International > Locations and International > Localization have been configured correctly. I have uploaded the override file you mentioned above and cleared the cache and nothing has changed Can you please suggest where else to look ? 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