Jump to content

Linked Orders - How To Turn Off?


Recommended Posts

Hi!

 

We have a big problem that luckily doesn't occur that often, with linked orders. We don't want them ever to happen. Because they add an extra shipping cost for every order, but we only send one package. We can't find any connection between the few orders why this happens. 

 

So how can we turn this off? And why do they occur? 

 

 

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

it seems it has to do with multi shipping. With multi shipping a customer can decide per product which shipping address to use. so customer can create 1 order and decide it has to be send to multiple addresses. then when the order is created, for each address a separate order is created. the payment though is always done with the last order only and the other orders are not update when the order is paid.

 

Now the strange thing is that this has been removed from prestashop since i think 1.6.0.11. So if you use an old prestashop installation, then it is probably the multi shipping option that you need to disable.

 

We are up to date with our shop 1.6.1.4 and this happened anyway. And that is very strange. So we are still in search to the root of the problem. We have a lot of overrides in our shop so maybe one of them is not properly updated with one of the upgrade rounds.

 

I have also contacted the customer to ask how he managed to do this. Once I know, I'll report back.

Link to comment
Share on other sites

we have been able to reproduce this

it turns out that it is indeed multi shipping.

 

if you add something to your shopping cart and go to checkout and choose an address, continue to payment methods. At that moment you continue shopping and add another product to your cart, go to checkout and choose a different address, then, when you finalise the order, two orders are created with to different shipping addresses.

 

coming week I will try to reproduce this with a clean install and the defult template. If it still happens the I will report this as a bug.

I'llkeep you posted.

Edited by ebonit (see edit history)
  • Like 1
Link to comment
Share on other sites

Thank you @ebonit for looking into this. I just can't see why Multi Shipping would have anything to do with this. There is no record of it in the database and every instance of multishipping in the code checks if true or false. Since it doesn't exist it will always return false.

 

But we found today a connection between the orders or more accurate the carts. It would be grateful if you could check this yourself, because we can't recreate any linked orders. In the ps_cart table we found that on these linked orders there was two addresses in the delivery_option table. Is this something that is the same for you? 

 

Our guess is that because there is two addresses then Prestashop think it should be split. So we are now gonna try and see if we can fix that. My guess is that the fix should be to always try have that column empty.

Link to comment
Share on other sites

The option Multi-shipping is splitting the orders into two or more orders, according to how many shipping addresses the customer had added to the order. If you don't want a split of orders, than you should disable this feature on tab: preferences -> orders -> delayed shipping = NO

Link to comment
Share on other sites

The option Multi-shipping is splitting the orders into two or more orders, according to how many shipping addresses the customer had added to the order. If you don't want a split of orders, than you should disable this feature on tab: preferences -> orders -> delayed shipping = NO

 

Hi!

 

That option is already disabled for all shops. So in our case that isn't the problem, but sounds like a solution  ^_^

Link to comment
Share on other sites

Hi!

 

That option is already disabled for all shops. So in our case that isn't the problem, but sounds like a solution  ^_^

If you disabled this option now, than only for new orders it will be take effect. For old orders it does not take any effect, cause they are already placed into the system ;)

Link to comment
Share on other sites

If you disabled this option now, than only for new orders it will be take effect. For old orders it does not take any effect, cause they are already placed into the system ;)

 

That option has been disabled since well I don't know, but from the beginning I would say. If we check the database there is no record of the PS_SHIP_WHEN_AVAILABLE. Sure we have some imported carts from the old database that have been struggling. But we are getting orders fro yesterday with carts created yesterday that generates a linked order. We managed to recreate on once by manipulate the cart directly. It's frustrating when you can't recreate it properly, so you have to guess and if you think you found a solution wait.

Link to comment
Share on other sites

If option is disabled than it could be a problem of a manipulated file ? Did you made some code adaptations ? The shop was upgraded from older version ?

 

Take also a look into this topic here: https://www.prestashop.com/forums/topic/327290-multi-shipping/

 

By disabling the delayed shipping it will also disable the multi-shipping mode on check-out process. I can confirm that there is no bug on it, not on native files and template files.

Link to comment
Share on other sites

we have been able to reproduce this

it turns out that it is indeed multi shipping.

 

if you add something to your shopping cart and go to checkout and choose an address, continue to payment methods. At that moment you continue shopping and add another product to your cart, go to checkout and choose a different address, then, when you finalise the order, two orders are created with to different shipping addresses.

 

coming week I will try to reproduce this with a clean install and the defult template. If it still happens the I will report this as a bug.

I'llkeep you posted.

 

I found the reason why two orders are created. It's like you describe it, just we can't recreate that. 

 

The order is created in PaymentModule::ValidateOrder in this function it gets a list from Cart::getPackageList. That list is split by two addresses so it creates one order with the same reference for each address. So where does the address comes from? Well in Cart::getPackageList it gets the products from Cart::getProducts and uses each products address. If you look in your database you and ps_cart_product you can see that for the cart the order was created the products have multiple addresses. So somehow the customer has managed to add products with different addresses to the cart. So hopefully we can manage to find a solution for this tomorrow.

Link to comment
Share on other sites

Seems that on checkout process the checkout template was reworked and this options is possible. Try to make a test order, or take a look into the checkout file (opc, or classic version - I don't know which one you are using).

 

Well that could be a reason since we have redone the templates and we have overrides. What we found also is that the cart is rather old compared to when the product was added. That somehow made it possible to add products with different id_delivery_addresses. Which is odd because when I change delivery address the system changes all the products id_delivery_address. But I would still say this is a bug in Prestashop since there is no configuration in our Prestashop that says we can do split orders. I think I will post a ticket on forge so the developers can look into it.

Link to comment
Share on other sites

We solved this today with an easy fix.

 

The problem is that the customer has managed to add products into the cart with different delivery addresses. You can check ps_cart_product table in the database to confirm this is the case. What happens then is that when an order is created it fetches a package list from the cart. The package list combines an array merged with the products for each address. So if there is multiple addresses for the products then there will be multiple orders with the same reference.

 

This solution is to make sure that the package list only contains one address.So we create an override of the Cart class and overrides the function getProductList. We simply look at the result and checks if the products id_delivery_address is the same as the cart if not set it to the carts address. This is the code we use:

public function getProducts($refresh = false, $id_product = false, $id_country = null)
{
    $product_list = parent::getProducts($refresh, $id_product, $id_country);
        
    foreach($product_list as &$product){
        if($product["id_address_delivery"] != $this->id_address_delivery) {
            $product["id_address_delivery"] = $this->id_address_delivery;
        }
    }
        
    return $product_list;
}

Thanks to ebonit and selectshop.at for all the help.

  • Like 3
  • Thanks 2
Link to comment
Share on other sites

  • 6 months later...

I just found that if you have products marked with "advanced stock management" and products without it then the shop generates linked orders for this products...

And worst of all... the shop doesn´t apply the shipping rates correctly.

 

I checked "advanced stock management" in all my products and problem resolved!!

My prestashop version is 1.6.0.6

 

I hope this tip helps anyone.

 

PD: sorry my english ;-)

Link to comment
Share on other sites

  • 4 years later...

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