Jump to content

[SOLVED] Cart cannot be loaded or an order has already been placed using this cart


Recommended Posts

This behavior was during a fresh install on both a live site and local? .. Walk me through the steps.

 

You added a new virtual product? What were the basic specifications of the order (immediately after installation)

Yes after a fresh installation local and live same problem ,

i'm building a mobile unlocking website via IMEI . so i need customer to enter his mobile phone IMEI with product .

Like in this image :

prestashoperror.jpg

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

Hi

Please a create a product like in this image :

 

prestashoperror.jpg

 

then login with customer account and try to buy this product , write something in IMEI field and click save === add to cart === checkout == choose pay by cheque or bank wire you will see a blank page after refrishing the page u will see that error ..

Thanks

Link to comment
Share on other sites

Hi Chahid, that did not happen with me. I got to the next page where it says

 

Please send us a cheque with:

 

- an amount of $149.00

 

- payable to the order of ___________

 

- mail to ___________

 

- Do not forget to insert your order reference PKONOERXY.

 

An e-mail has been sent to you with this information.

 

Your order will be sent as soon as we receive your payment.

 

For any questions or for further information, please contact our customer support.

 

This was on a localhost.

 

Did you set the product to be virtual? Because I did not. I also had to choose a shipping carrier, which was "free" that I set up.

Link to comment
Share on other sites

When i create product as virtual i still get the error , but when i create a product then i edit it to virtual i didn't get that error !

Here always i choose No : Does this product have an associated file? No

 

Thank u so much , the problem solved now

Link to comment
Share on other sites

  • 7 months later...

When i create product as virtual i still get the error , but when i create a product then i edit it to virtual i didn't get that error !

Here always i choose No : Does this product have an associated file? No

 

Thank u so much , the problem solved now

 

I'm getting this same error "Cart cannot be loaded or an order has already been placed using this cart." This error only occurs sometimes in my prestashop version 1.4.7 and I don`t know why. The transaction sometimes end well and others do not and shows the error

 

I've done everything you say in this post and others things I've found on other pages and the problem continues.

 

I don't know what else to do )=

 

Link to comment
Share on other sites

  • 8 months later...
  • 1 month later...

I'm facing the same problem after a change from php 5.3. to php 5.4. It seems to be an incompatibility Prestashop 1.5.3.1. or cheque module with php 5.4.31. Try to use another php-version , if possible or at least upgrade the bankwire module.

The cart I've added for a customer was a complete new one and not a refreshed. Although you have a blank page, or when debug modus activated the error "Cart cannot be loaded or an order has already been placed using this cart", the order was placed. So it's a cosmetic problem and no order is going to be lost.

  • Like 1
Link to comment
Share on other sites

  • 4 months later...
  • 4 months later...
  • 1 month later...

hi

 

finally i solved this problem

 

Disable the force enable ssl in perference>general

 

and also set config files

Config.inc file place this line in any where

int_set(memory_limit='125M')

Hi

 

Is this setup also for 1.5, because in 1.6 there isn't force enable ssl in perference>general.

 

Also the code in config.inc is the same?

 

 

This topic is not solved. Does anyone have a solution for this error?

"Cart cannot be loaded or an order has already been placed using this cart"

 

With respect,

Silviu

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

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

I had the same issue on my store. 

Error message when manually adding an order in the back-office: "Cart cannot be loaded or an order has already been placed using this cart". 

Hope this helps!

 

Here are the steps that caused my bug. 

1) Sign in as customer and add any product to cart (do not check out)
2) From the back-office -> Customers -> Shopping carts -> View the abandoned cart and create an order from this cart (order creates successfully) 
3) From Back-office -> Orders -> Create new Order -> Search for the same Customer and try to create a new order
4) The product from the previous order shows up
5) Remove the product from the cart section in the new order page
6) Search for any product and add it
7) Click "Create the Order"
8) Error Message "Cart cannot be loaded or an order has already been placed using this cart"

 

Here's how i fixed it.

/classes/Cart.php

 

    public function orderExists()
    {
        $cache_id = 'Cart::orderExists_'.(int)$this->id;
        if (!Cache::isStored($cache_id)) {
            $result = (bool)Db::getInstance()->getValue('SELECT count(*) FROM `'._DB_PREFIX_.'orders` WHERE `id_cart` = '.(int)$this->id);
            Cache::store($cache_id, $result);
            - return $result;
            + return false;
        }
        return Cache::retrieve($cache_id);
    }
Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...
  • 5 weeks later...
  • 1 month later...
  • 4 weeks later...
  • 2 months later...

Hello all,

i Just upgrade to 1.6.1.5 and have this problem with bankwire. It is just easy to solve this problem, i just reset bankwire modul, add my bank account detail again (after i reset that modul, my bank detail dissapear, ofcourse), and the problem solved. try this

Link to comment
Share on other sites

  • 4 months later...

Hello all,

i Just upgrade to 1.6.1.5 and have this problem with bankwire. It is just easy to solve this problem, i just reset bankwire modul, add my bank account detail again (after i reset that modul, my bank detail dissapear, ofcourse), and the problem solved. try this

 

With Prestashop 1.6.1 I have the bankwire module disabled. Only the Authorize.net module is enabled. The system seems to work, but often in the error log I have this error:

 

"Frontcontroller::init - Cart cannot be loaded or an order has already been placed using this cart"

  • Like 1
Link to comment
Share on other sites

  • 1 year later...
On 10/21/2017 at 6:08 AM, Joolivus said:

Tried everything suggested in this topic nothing solved my problem.
after upgrading PHP from 5.3 to 7.0 and upgrading my shop to 1.6.1.16
Can't even change order status to "Waiting Bank Wire Payment"

This topic is long from SOLVED

Is your issue the meaningless warning message appearing in the Logs page, or a failed upgrade?  Realize they are unrelated to each

Link to comment
Share on other sites

1 hour ago, bellini13 said:

Is your issue the meaningless warning message appearing in the Logs page, or a failed upgrade?  Realize they are unrelated to each

Many thanks for your reply and concern.
My issue is related with the warning message.
This wasn't happening 4 months ago but got information from my host provider about php 5.3 no longer get support so decided to upgrade system + prestashop.

When customer pays with paypal they can complete all the steps on purchase, nobody is reporting me issues at all.
But when paying with Bank Transfer, they never get into the last page and receive the confirmation email, although shop registers new order and i get: email with new order + warning message in the logs.

Tried everything explained in this topic by other users, nothing solved my issue.

Link to comment
Share on other sites

However, as I said, the warning message in the Logs page has nothing to do with your inability to use the bankwire module.

I would suggest you open a separate issue you are having with the bankwire module, and stop referring to the meaningless warning message in the Logs page, it has not bearing on the issue you are having.

Link to comment
Share on other sites

  • 2 years later...

same problem when createding orders from the backend 1.7.5-1.7.6.1

An order has already been placed with this cart.
This product cannot be added to the cart.

 

It works then after placing a few orders it stops working. I dont know why there is no solution many people seem to have this issue.

I have tried all the selected solutoions above

  • change ssl
  • change php version tried 7.0 7.1 7.2
  • increase memory
  • add code to /classes/Cart.php
  • changed payment methods....
  • upgraded to latest version

 

any one any ideas?

Link to comment
Share on other sites

  • 4 months later...

I've the same problem with PS 1.6.

I think the issue occurs when the cart already exists in cookie, order object has already been created but not completed. When user go back some days later to the cart and proceed with checkout, in this case we are going inside this code in FrontControllet.init:

            if (Validate::isLoadedObject($cart) && $cart->OrderExists()) {
                PrestaShopLogger::addLog('Frontcontroller::init - Cart cannot be loaded or an order has already been placed using this cart', 1, null, 'Cart', (int)$this->context->cookie->id_cart, true);
                unset($this->context->cookie->id_cart, $cart, $this->context->cookie->checkedTOS);
                $this->context->cookie->check_cgv = false;
            }

But then when PaymentModule.validate is called, cart does not have product and OrderDetail records are not created.

So I think we should test also of orderDetail records exist for this cart before doing unset:

            if (Validate::isLoadedObject($cart) && $cart->OrderExists()) {
                $orderId = Db::getInstance()->getValue('SELECT `id_order` FROM `'._DB_PREFIX_.'orders` WHERE `id_cart` = '.(int)$cart->id);
                $hasDetailOrder = (bool)Db::getInstance()->getValue('SELECT count(*) FROM `'._DB_PREFIX_.'order_detail` WHERE `id_order` = '.(int)$orderId);
                if($hasDetailOrder) {
                    PrestaShopLogger::addLog('Frontcontroller::init - Cart cannot be loaded or an order has already been placed using this cart', 1, null, 'Cart', (int)$this->context->cookie->id_cart, true);
                    unset($this->context->cookie->id_cart, $cart, $this->context->cookie->checkedTOS);
                    $this->context->cookie->check_cgv = false;
                }
            }

It has to be done overriding the class.

Link to comment
Share on other sites

  • 1 month later...

Hi,

I am having the same issue in Prestashop version 1,6,1,20. 

Some customers when click de button to go to the payment page they got a blank page and at the logs page of prestashop I get this error: Frontcontroller::init - Cart cannot be loaded or an order has already been placed using this cart.

I read the post above and I would like to know where can I place this code below. In which page?

if (Validate::isLoadedObject($cart) && $cart->OrderExists()) { $orderId = Db::getInstance()->getValue('SELECT `id_order` FROM `'._DB_PREFIX_.'orders` WHERE `id_cart` = '.(int)$cart->id); $hasDetailOrder = (bool)Db::getInstance()->getValue('SELECT count(*) FROM `'._DB_PREFIX_.'order_detail` WHERE `id_order` = '.(int)$orderId); if($hasDetailOrder) { PrestaShopLogger::addLog('Frontcontroller::init - Cart cannot be loaded or an order has already been placed using this cart', 1, null, 'Cart', (int)$this->context->cookie->id_cart, true); unset($this->context->cookie->id_cart, $cart, $this->context->cookie->checkedTOS); $this->context->cookie->check_cgv = false; } }

Can ou help me please?

Thanks,

Claudia Llana

Link to comment
Share on other sites

On 5/7/2020 at 4:50 AM, pascal-ld said:

Hi Claudia,

you have to copy the FrontController class to override/classes/controller, let just the init mehtod with this new code on line +/- 306

Regards

Pascal

Ok, you mean that I need to copy this class:

if (Validate::isLoadedObject($cart) && $cart->OrderExists()) { $orderId = Db::getInstance()->getValue('SELECT `id_order` FROM `'._DB_PREFIX_.'orders` WHERE `id_cart` = '.(int)$cart->id); $hasDetailOrder = (bool)Db::getInstance()->getValue('SELECT count(*) FROM `'._DB_PREFIX_.'order_detail` WHERE `id_order` = '.(int)$orderId); if($hasDetailOrder) { PrestaShopLogger::addLog('Frontcontroller::init - Cart cannot be loaded or an order has already been placed using this cart', 1, null, 'Cart', (int)$this->context->cookie->id_cart, true); unset($this->context->cookie->id_cart, $cart, $this->context->cookie->checkedTOS); $this->context->cookie->check_cgv = false; } }

and place it at override/classes/controller but in which file should I do that? Because that are lots of files inside the folder controller.

Thanks,

Claudia Llana

Edited by Claudia Llana (see edit history)
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...