eZ Community » Forums » Developer » Shipping Handler (Legacy Stack)
expandshrink

Shipping Handler (Legacy Stack)

Shipping Handler (Legacy Stack)

Monday 06 May 2013 2:14:45 am

Hi All,

I've just been writing a custom shipping handler and I was having issues with the VAT value not being passed into the order correctly.

It was find in shop/basket but when you got to shop/confirm order the vat value was being dropped by the system and thus the VAT percentage was not being applied to the shipping price for the order.

On tracking through this issue I've found the following:

On line 243 of kernel/shop/ezshopoperationcollection.php you find the following order item object creation.

$orderItem = new eZOrderItem( array( 'order_id' => $orderID,
    'description' => $shippingInfo['description'],
    'price' => $shippingInfo['cost'],
    'vat' => $shippingInfo['vat_value'],
    'is_vat_inc' => $shippingInfo['is_vat_inc'],
    'type' => 'ezcustomshipping' ) );

When looking at the eZOrderItem class the defenition() method is expecting "vat_value".

This should mean that above mentioned line should look like.

$orderItem = new eZOrderItem( array( 'order_id' => $orderID,
    'description' => $shippingInfo['description'],
    'price' => $shippingInfo['cost'],
    'vat_value' => $shippingInfo['vat_value'],
    'is_vat_inc' => $shippingInfo['is_vat_inc'],
    'type' => 'ezcustomshipping' ) );

I have updated and tested this on site I am working on and it all seems to be working as expected now.

I usually am not keen on editing kernel files in this way but in this case I think it is just a mistake.

I would be more than happy to update this and create a pull request but I've never done that before. I am just wondering if I should go about doing this?

Edit: I have attempted to make the code display as simply as possible. It seems TincyMCE doesn't like me pasting code into the literal boxes for some reason.

Modified on Monday 06 May 2013 2:19:12 am by Daniel Clements

No reply yet!

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from