Page 1 of 1

Tax Code Broadleaf Admin 3.0

Posted: Fri Jul 26, 2013 5:17 am
by smaris
Hi,

I am trying to customise the backend in order to have 3 tax codes available. Each product can have there own tax code according to the type of product. How can I provide the tax codes?

The documentation says to use the TaxModule which is deprecated. I tried to implement a ProductTaxProvider which implements TaxProvider. This provider only provides the order. How can I calculate the tax codes that are defined on a product when I only have an Order object available?

Re: Tax Code Broadleaf Admin 3.0

Posted: Fri Jul 26, 2013 8:48 am
by phillipuniverse
1) Loop through the FulfillmentGroupItems:

for (FulfillmentGroup fg : order.getFulfillmentGroups) {
for (FulfillmentGroupItem fgItem : fg.getFulfillmentGroupItems()) {
Sku sku = fgItem.getOrderItem().getSku();
}
}

2) For each fulfillment group item, compute and assign tax based on the tax code.

Re: Tax Code Broadleaf Admin 3.0

Posted: Wed Jul 31, 2013 3:59 am
by smaris
There is no "getOrderItem().getSku();" for 3.x?

Re: Tax Code Broadleaf Admin 3.0

Posted: Thu Aug 01, 2013 8:59 am
by phillipuniverse
Sorry about that, look at the type hierarchy for OrderItem. In nearly every case, OrderItems are specific instances of either DiscreteOrderItem or BundleOrderItem. You can cast to one of those and glean the Sku from there.