Jump to content

shop id 0 is invalid


tank

Recommended Posts

when I click to view an order I get this.   

Shop id 0 is invalid. Shop id must be number that is greater than zero.

Exception

Logs 2

Stack Trace

PrestaShop\PrestaShop\Core\Domain\Shop\Exception\ShopException

in src/Core/Domain/Shop/ValueObject/ShopGroupId.php (line 68)

     * @throws ShopException

     */

    private function assertIsGreaterThanZero(int $shopGroupId): void

    {

        if (0 >= $shopGroupId) {

            throw new ShopException(

                sprintf(

                    'Shop id %s is invalid. Shop id must be number that is greater than zero.',

                    var_export($shopGroupId, true)

                )

            );

Link to comment
Share on other sites

  • 1 month later...
  • 4 weeks later...
  • 1 month later...

Prestashop introduced multishop in version 1.5. It looks like MP doesn't handle the transition well.

One option would be to upgrade to 1.5 first and then use MP.

Another option would be to check the *_shop tables in 1.7 and to set their id_shop fields to 1 for all records.

Link to comment
Share on other sites

  • 11 months later...

Hello,

I have a site (without multishop), and during the partial refund of an order I have this error: 
An unexpected error occurred. [PrestaShopPrestaShopCoreDomainShopException code 0]: Shop id 0 is invalid. Shop id must be number that is greater than zero.

Any idea ?

Link to comment
Share on other sites

il y a 22 minutes, JulienPct a dit :

I actually read the messages above and tried the same method however all my tables are correct, at least the shops are all at 1

This must mean that you do not have the same concern and that it would be better to open your own Topic.

  • Thanks 1
Link to comment
Share on other sites

N

18 hours ago, JulienPct said:

An unexpected error occurred. [PrestaShopPrestaShopCoreDomainShopException code 0]: Shop id 0 is invalid. Shop id must be number that is greater than zero.

It depends on where in the code the error happened. There must be some file and some line number.

So you need to look at that code and make your guesses. It can also be that some query returned an empty result and that that was translated in the code as a zero for the id_shop.

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...