• Welcome to KonaKart Community Forum. Please login or sign up.
 

new order total

Started by Iruñea, December 22, 2008, 10:58:16 am

Previous topic - Next topic

Iruñea

Hello

Ive created a new order total module. Into the method
public OrderTotal getOrderTotal(Order order, boolean dispPriceWithTax, Locale locale){...}

I want to know how many products are in the order but when I try to get this by order.getNumProducts() it gives me 0.
If I make a order.getId() it also gives me 0.

However when I make order.getSubTotalExTax() it gives the correct amount so, the cuestion is; how can I get the full populated Order ??

Thanks!

trevor

The order hasn't been saved yet at this point so we don't have an id. The array of OrderProducts contains all of the products.

Iruñea


Iruñea

Ive still a problem. The order total amount is calculated correctly but iIt doesn't add this price automatically to the TOTAL PRICE OF THE ORDER. In theory this add to be done automatically:

Quote...You don't need to do anything else as long as the "Total" module is placed at the bottom of the list of order total modules. In this case it should automatically create a total using your new module(s) as well as any other modules above it (i.e. discount, shipping, sub total etc.)


But it does not. So the cuestion is: In which class/method is sumed all this amounts to the total Price of the order??
If its in order.getTotalIncTax(), where can I find it?


Thank you

trevor

Ok. What you need to do is to get your Order Total module to to add or subtract its amount from the total of the order when it is called.

e.g. order.setTotalIncTax(order.getTotalIncTax().subtract(myOt.getValue()));

Iruñea

Thank you Trevor,
thats the answer I was looking for !!
:)