Developer forum

Forum » Development » Sorting the orderLines

Sorting the orderLines


Reply

Is there a way to sort orderlines?

My problem is that all my duscounts are placed at the bottom and I whant to place them after the product that has this discount.

Example:

 

Product1

Discount Product1

Product2

Discount Product2

 

Maby it's the whay I'm adding the discount thats wrong and that I have to do it in another whay to get this right.

 

I'm looping trough all the orderlines adding the orderline and if there is a discount I'm adding these to a temp order object. When the loop has gone trough all orderlines I'm copying the themp order back to the order object.

 

Is there sommeting wrong whit this?

Should I add my discounts in another whay?


Replies

 
Reply

You can't sort the order lines, but instead of adding a discount, you can add an order line of a product containing a negative price at the same time the product is being added to the basket. Then this "discount" will be listed after the order line that the user added.

 
Reply
Sorensen wrote:

You can't sort the order lines, but instead of adding a discount, you can add an order line of a product containing a negative price at the same time the product is being added to the basket. Then this "discount" will be listed after the order line that the user added.


How do I do this?

Will the discounts still de handled as discounts?

 

 
Reply

The "Extensibility API" documentation available here http://documentation.dynamicweb.dk/Development-23323.aspx contains information about how to add a discount. A discount is basically an order line with a different order line type. Just follow the steps described here.

 
Reply
Sorensen wrote:

The "Extensibility API" documentation available here http://documentation.dynamicweb.dk/Development-23323.aspx contains information about how to add a discount. A discount is basically an order line with a different order line type. Just follow the steps described here.

Isn't the discount called when entering the cart?

How do I get it to call the discount when adding to the cart?

 
Reply

Make a notification subscriber on this notification: Dynamicweb.Notifications.eCommerce.Cart.Line.Added

 

You must be logged in to post in the forum