Example #1
0
 /**
  * @param                 $billing
  * @param                 $shipping
  * @param Customer        $customer
  * @param ArrayCollection $item
  * @param CartStatus      $status
  *
  * @return Cart
  */
 protected function createCart($billing, $shipping, Customer $customer, ArrayCollection $item, $status)
 {
     $cart = new Cart();
     $cart->setChannel($this->integration);
     $cart->setDataChannel($this->channel);
     $cart->setBillingAddress($billing);
     $cart->setShippingAddress($shipping);
     $cart->setCustomer($customer);
     $cart->setEmail('*****@*****.**');
     $cart->setCreatedAt(new \DateTime('now'));
     $cart->setUpdatedAt(new \DateTime('now'));
     $cart->setCartItems($item);
     $cart->setStatus($status);
     $cart->setItemsQty(0);
     $cart->setItemsCount(1);
     $cart->setBaseCurrencyCode('code');
     $cart->setStoreCurrencyCode('code');
     $cart->setQuoteCurrencyCode('usd');
     $cart->setStoreToBaseRate(12);
     $cart->setGrandTotal(2.54);
     $cart->setIsGuest(0);
     $cart->setStore($this->store);
     $cart->setOwner($this->getUser());
     $cart->setOrganization($this->organization);
     $this->em->persist($cart);
     return $cart;
 }