Developer forum

Forum » Ecommerce - Standard features » Different orderlines for same product

Different orderlines for same product

Paul Nilsson
Reply

Is there a way to create different orderlines for the same product?
The reason for this is to make it possible for the customer to order pruducts ahead in time but on the same order.
 

Example:

500 penns delivered 2014-09-25
200 penns delivered 2014-10-25

In this case the customer orders 700 penns but only wants 500 penns now and the rest one month later.

 

 


Replies

 
Nuno Aguiar
Reply

Hi Paul,

 

We built a solution with a similar situation and integration. It is not as straight forward as a normal cart.

 

  • We had to create custom fields to store stock and stock date
  • When adding to the cart we had an order matrix so the user added exactly X quantities to be delivered at Y date
  • We needed to store that into session/js variables to set as orderline fields on the product

 

We were still ordering 700 products, but custom development updated the "correct" stock fields and orderline fields listed "500 delivered on 2014-09-25 <br> 200 delivered on 2014-10-25"

 

Does that make any sense?

 

Best Regards,

Nuno

 
Paul Nilsson
Reply

Thanks Nuno

Yes, it does.
I was just hoping for a simpler solution.

 

/Paul

 

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

If you have an orderline field for the date, the cart should differentiate between the two products. Would that be enough?

 

Imar

 
Paul Nilsson
Reply

Well if the cart thinks it's a different product and puts it on a second orderline.

Then it should be enough.

I'll have to try it, sounds to simple to be true.

 

/Paul

 

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

It does for me. I have a custom configurator that sets an orderline field to the ID of the configurator which results in two separate orderlines. I believe you get a unique line for each unique combination of order line fields.

Imar

 
Nicolai Høeg Pedersen
Reply

@Imar, Yes that is correct.

Also it is possible to use order contexts - but that would give an cart/order for each delivery date.

Nicolai

 
Paul Nilsson
Reply

I have now tryed to add the a new row and thats no problem.
The problem I have now is the cart(see image).

In the databse the orderlines look just fine.
But in the cart it takes the value of the new orderline and shows that for both.

It is only when I put up a new dll-file and efeything is reloaded that the correct orderlines are shown.

I have tried to use these to ger the cart to show the correct values.
Dynamicweb.eCommerce.Common.Context.SetCart(added.Cart);
Dynamicweb.eCommerce.Frontend.Cart.CartCatch.SaveCart();
 

What can I do to make the cart show the correct orderlines?

DoubleOlderLines.jpg

 

You must be logged in to post in the forum