Skip to content

Commit

Permalink
Fixed shipping cost calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
aimeos committed Jul 7, 2017
1 parent 4e051ca commit 5c1f219
Showing 1 changed file with 4 additions and 3 deletions.
Expand Up @@ -661,7 +661,7 @@ protected function getOrderDetails( \Aimeos\MShop\Order\Item\Base\Iface $orderBa
$lastPos = $product->getPosition() - 1;

$deliveryPrice = clone $price;
$deliveryPrices = $this->addPrice( $deliveryPrices, $deliveryPrice->setValue( '0.00' ) );
$deliveryPrices = $this->addPrice( $deliveryPrices, $deliveryPrice->setValue( '0.00' ), $product->getQuantity() );

$values['L_PAYMENTREQUEST_0_NUMBER' . $lastPos] = $product->getId();
$values['L_PAYMENTREQUEST_0_NAME' . $lastPos] = $product->getName();
Expand Down Expand Up @@ -756,9 +756,10 @@ protected function getOrderServiceItem( $baseid )
*
* @param \Aimeos\MShop\Price\Item\Iface[] $prices Associative list of tax rates as key and price items as value
* @param \Aimeos\MShop\Price\Item\Iface $price Price item that should be added
* @param integer $quantity Product quantity
* @return \Aimeos\MShop\Price\Item\Iface[] Updated list of price items
*/
protected function addPrice( array $prices, $price )
protected function addPrice( array $prices, $price, $quantity = 1 )
{
$taxrate = $price->getTaxRate();

Expand All @@ -768,7 +769,7 @@ protected function addPrice( array $prices, $price )
$prices[$taxrate]->setTaxRate( $taxrate );
}

$prices[$taxrate]->addItem( $price );
$prices[$taxrate]->addItem( $price, $quantity );

return $prices;
}
Expand Down

0 comments on commit 5c1f219

Please sign in to comment.