本文整理汇总了PHP中Sylius\Component\Core\Model\OrderItemInterface::getDiscountedUnitPrice方法的典型用法代码示例。如果您正苦于以下问题:PHP OrderItemInterface::getDiscountedUnitPrice方法的具体用法?PHP OrderItemInterface::getDiscountedUnitPrice怎么用?PHP OrderItemInterface::getDiscountedUnitPrice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sylius\Component\Core\Model\OrderItemInterface
的用法示例。
在下文中一共展示了OrderItemInterface::getDiscountedUnitPrice方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
function it_executes_request(InvoiceNumberGeneratorInterface $invoiceNumberGenerator, CurrencyConverterInterface $currencyConverter, Convert $request, PaymentInterface $payment, OrderInterface $order, OrderItemInterface $orderItem, ProductVariantInterface $productVariant, ProductInterface $product)
{
$request->getTo()->willReturn('array');
$payment->getId()->willReturn(19);
$order->getId()->willReturn(92);
$order->getId()->willReturn(92);
$order->getCurrencyCode()->willReturn('PLN');
$order->getTotal()->willReturn(22000);
$order->getItems()->willReturn([$orderItem]);
$order->getAdjustmentsTotalRecursively(AdjustmentInterface::TAX_ADJUSTMENT)->willReturn(0);
$order->getOrderPromotionTotal()->willReturn(0);
$order->getShippingTotal()->willReturn(2000);
$orderItem->getVariant()->willReturn($productVariant);
$orderItem->getDiscountedUnitPrice()->willReturn(20000);
$orderItem->getQuantity()->willReturn(1);
$productVariant->getProduct()->willReturn($product);
$product->getName()->willReturn('Lamborghini Aventador Model');
$request->getSource()->willReturn($payment);
$payment->getOrder()->willReturn($order);
$invoiceNumberGenerator->generate($order, $payment)->willReturn('19-92');
$currencyConverter->convertFromBase(22000, 'PLN')->willReturn(88000);
$currencyConverter->convertFromBase(20000, 'PLN')->willReturn(80000);
$currencyConverter->convertFromBase(2000, 'PLN')->willReturn(8000);
$details = ['PAYMENTREQUEST_0_INVNUM' => '19-92', 'PAYMENTREQUEST_0_CURRENCYCODE' => 'PLN', 'PAYMENTREQUEST_0_AMT' => 880.0, 'PAYMENTREQUEST_0_ITEMAMT' => 880.0, 'L_PAYMENTREQUEST_0_NAME0' => 'Lamborghini Aventador Model', 'L_PAYMENTREQUEST_0_AMT0' => 800.0, 'L_PAYMENTREQUEST_0_QTY0' => 1, 'L_PAYMENTREQUEST_0_NAME1' => 'Shipping Total', 'L_PAYMENTREQUEST_0_AMT1' => 80.0, 'L_PAYMENTREQUEST_0_QTY1' => 1];
$request->setResult($details)->shouldBeCalled();
$this->execute($request);
}