Developer forum

Forum » Ecommerce - Standard features » Which orderline has a discount?

Which orderline has a discount?

Jakob Westhausen
Reply

When a customer buys multiple products with one or more products on discount, the client has difficulties determine which product (orderline) has a discount in case of a refound or return shipment.
The discount orderline dosen't seem to be related to the product and it is also unclear from the order log. I hope you can help us and our clients with this issue.

 

Best regards

Jakob Westhausen


Replies

 
Nicolai Høeg Pedersen
Reply

The orderline has a parentid that will tell you which orderline it is. If it is related to an orderline.

You could have 10% discount if cart total is more than 1000 - that would be an order discount and is not related to an orderline.

BR Nicolai

 
Jakob Westhausen
Reply

Hey Nicolai

If we could find the discount related to the orderline by parentid, that would be great, but I look like the parentid is null.

http://screencast.com/t/qeiXECkUv

 

 
Nicolai Høeg Pedersen
Reply

But how does that discount look like?

 
Jakob Westhausen
Reply

We use the "Product total price order field discount" so it should add a parentid to the discount orderline.

 

Screen_Shot_2016-06-07_at_11.10.48.png
 
Nicolai Høeg Pedersen
Reply

Well that is an order discount and is not related to the orderline it self... So if I have 2 products from that list, the total is more than 1000 and the voucher is applied, the discount is valid.

Can you tell me which of the products that gives the discount?

BR Nicolai

 
Jakob Westhausen
Reply

Yes of course, it's the "Bike Fitness Shoe" that has the discount. On this solution: http://newline2.dev.nozebrahosting.dk

 
Nicolai Høeg Pedersen
Reply

My question was:

That discount you have created includes a lot of different products. If I add more than one of them to the cart, the cart total is more than 1000, and add my voucher, how can you tell which of the 2 products is getting the discount? It is none of them, but the combination that gives the discount...

The discount you use is an order discount - it is applied to the order (and not the orderline) because it is depending on the entire order be calculated. And if I remove one orderline, the discount goes away, but also if I remove the other one.

So this kind of discount is not coming from a specific orderline - and therefore not related to an orderline...

BR Nicolai

 
Jakob Westhausen
Reply

We haven't activated the buy limitation so that shoulden't be an issue. So which discount type would you recommend if we wan't to use the voucher discount field and attatch a discount to the orderline?

 
Nicolai Høeg Pedersen
Reply

My point is, you cannot. This is an orderdiscount. I can get you the code and you can change the logic so it somehow will know... But I cannot figure out how to do it.

If I add 2 products, both from the list of valid products, and get 10% discount for the voucher for each of them. Then there is one discount line - but 2 orderlines with the products. Which orderline does the discount belong to? As it is made now, it is not 1-1 for discount and orderline.

So you would have to create a discount that would add a discount orderline for each product that gets the discount in order to find the discount line in question....

BR Nicolai

 
Jakob Westhausen
Reply

Yes one discount line that contains product id's related to the discount. Eg. An array of product id's on the discount line. This is properly a feature request, but I would be a very helpful information for our clients.

 
Nicolai Høeg Pedersen
Reply

I understand what you need - but also know too much about discounts to know it would give false positives...

If you need this, you can get the code for this discount and change it to record that data on the discount line.

BR Nicolai

 

You must be logged in to post in the forum