Jump to content

1.7.6.9 Multistore - Unfortunately, there are no carriers available for your delivery address.


Recommended Posts

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 :)

Screenshot 2021-01-19 at 09.32.17.png

Edited by grovers (see edit history)

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Screenshot 2021-01-19 at 18.58.03.png

Screenshot 2021-01-19 at 18.58.35.png

Screenshot 2021-01-19 at 19.01.21.png

Edited by grovers (see edit history)

Share this post


Link to post
Share on other sites

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

 

Share this post


Link to post
Share on other sites

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

Screenshot 2021-01-22 at 11.51.48.png

Share this post


Link to post
Share on other sites
  • 2 weeks later...

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

Share this post


Link to post
Share on other sites
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 :)

Screenshot 2021-01-19 at 09.32.17.png

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?

Share this post


Link to post
Share on other sites

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

Screenshot 2021-02-10 at 22.09.11.png

Screenshot 2021-02-10 at 22.12.15.png

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

Important Information

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