| @@ 570-599 (lines=30) @@ | ||
| 567 | * |
|
| 568 | * @return Order |
|
| 569 | */ |
|
| 570 | protected function createOrder(Cart $cart, Customer $customer) |
|
| 571 | { |
|
| 572 | $order = new Order(); |
|
| 573 | $order->setChannel($this->integration); |
|
| 574 | $order->setDataChannel($this->channel); |
|
| 575 | $order->setStatus('open'); |
|
| 576 | $order->setIncrementId('100000307'); |
|
| 577 | $order->setCreatedAt(new \DateTime('now')); |
|
| 578 | $order->setUpdatedAt(new \DateTime('now')); |
|
| 579 | $order->setCart($cart); |
|
| 580 | $order->setStore($this->store); |
|
| 581 | $order->setCustomer($customer); |
|
| 582 | $order->setCustomerEmail('[email protected]'); |
|
| 583 | $order->setDiscountAmount(4.40); |
|
| 584 | $order->setTaxAmount(12.47); |
|
| 585 | $order->setShippingAmount(5); |
|
| 586 | $order->setTotalPaidAmount(17.85); |
|
| 587 | $order->setTotalInvoicedAmount(11); |
|
| 588 | $order->setTotalRefundedAmount(4); |
|
| 589 | $order->setTotalCanceledAmount(0); |
|
| 590 | $order->setShippingMethod('some unique shipping method'); |
|
| 591 | $order->setRemoteIp('127.0.0.1'); |
|
| 592 | $order->setGiftMessage('some very unique gift message'); |
|
| 593 | $order->setOwner($this->getUser()); |
|
| 594 | $order->setOrganization($this->organization); |
|
| 595 | ||
| 596 | $this->em->persist($order); |
|
| 597 | ||
| 598 | return $order; |
|
| 599 | } |
|
| 600 | ||
| 601 | /** |
|
| 602 | * @param Cart $cart |
|
| @@ 606-636 (lines=31) @@ | ||
| 603 | * |
|
| 604 | * @return Order |
|
| 605 | */ |
|
| 606 | protected function createGuestOrder(Cart $cart) |
|
| 607 | { |
|
| 608 | $order = new Order(); |
|
| 609 | $order->setChannel($this->integration); |
|
| 610 | $order->setDataChannel($this->channel); |
|
| 611 | $order->setStatus('open'); |
|
| 612 | $order->setIncrementId('100000308'); |
|
| 613 | $order->setCreatedAt(new \DateTime('now')); |
|
| 614 | $order->setUpdatedAt(new \DateTime('now')); |
|
| 615 | $order->setCart($cart); |
|
| 616 | $order->setStore($this->store); |
|
| 617 | $order->setCustomer(null); |
|
| 618 | $order->setIsGuest(1); |
|
| 619 | $order->setCustomerEmail('[email protected]'); |
|
| 620 | $order->setDiscountAmount(4.40); |
|
| 621 | $order->setTaxAmount(12.47); |
|
| 622 | $order->setShippingAmount(5); |
|
| 623 | $order->setTotalPaidAmount(17.85); |
|
| 624 | $order->setTotalInvoicedAmount(11); |
|
| 625 | $order->setTotalRefundedAmount(4); |
|
| 626 | $order->setTotalCanceledAmount(0); |
|
| 627 | $order->setShippingMethod('some unique shipping method'); |
|
| 628 | $order->setRemoteIp('127.0.0.1'); |
|
| 629 | $order->setGiftMessage('some very unique gift message'); |
|
| 630 | $order->setOwner($this->getUser()); |
|
| 631 | $order->setOrganization($this->organization); |
|
| 632 | ||
| 633 | $this->em->persist($order); |
|
| 634 | ||
| 635 | return $order; |
|
| 636 | } |
|
| 637 | ||
| 638 | /** |
|
| 639 | * @param Order $order |
|