| @@ 159-189 (lines=31) @@ | ||
| 156 | * | |
| 157 | * @return Cart | |
| 158 | */ | |
| 159 | protected function createCart($billing, $shipping, Customer $customer, ArrayCollection $item, $status) | |
| 160 |     { | |
| 161 | $cart = new Cart(); | |
| 162 | $cart->setOriginId(100); | |
| 163 | $cart->setChannel($this->integration); | |
| 164 | $cart->setDataChannel($this->channel); | |
| 165 | $cart->setBillingAddress($billing); | |
| 166 | $cart->setShippingAddress($shipping); | |
| 167 | $cart->setCustomer($customer); | |
| 168 |         $cart->setEmail('[email protected]'); | |
| 169 |         $cart->setCreatedAt(new \DateTime('now')); | |
| 170 |         $cart->setUpdatedAt(new \DateTime('now')); | |
| 171 | $cart->setCartItems($item); | |
| 172 | $cart->setStatus($status); | |
| 173 | $cart->setItemsQty(0); | |
| 174 | $cart->setItemsCount(1); | |
| 175 |         $cart->setBaseCurrencyCode('code'); | |
| 176 |         $cart->setStoreCurrencyCode('code'); | |
| 177 |         $cart->setQuoteCurrencyCode('usd'); | |
| 178 | $cart->setStoreToBaseRate(12); | |
| 179 | $cart->setStoreToQuoteRate(12); | |
| 180 | $cart->setGrandTotal(2.54); | |
| 181 | $cart->setIsGuest(0); | |
| 182 | $cart->setStore($this->store); | |
| 183 | $cart->setOwner($this->getUser()); | |
| 184 | $cart->setOrganization($this->organization); | |
| 185 | ||
| 186 | $this->em->persist($cart); | |
| 187 | ||
| 188 | return $cart; | |
| 189 | } | |
| 190 | ||
| 191 | /** | |
| 192 | * @param $billing | |
| @@ 199-229 (lines=31) @@ | ||
| 196 | * | |
| 197 | * @return Cart | |
| 198 | */ | |
| 199 | protected function createGuestCart($billing, $shipping, ArrayCollection $item, $status) | |
| 200 |     { | |
| 201 | $cart = new Cart(); | |
| 202 | $cart->setOriginId(101); | |
| 203 | $cart->setChannel($this->integration); | |
| 204 | $cart->setDataChannel($this->channel); | |
| 205 | $cart->setBillingAddress($billing); | |
| 206 | $cart->setShippingAddress($shipping); | |
| 207 | $cart->setCustomer(null); | |
| 208 |         $cart->setEmail('[email protected]'); | |
| 209 |         $cart->setCreatedAt(new \DateTime('now')); | |
| 210 |         $cart->setUpdatedAt(new \DateTime('now')); | |
| 211 | $cart->setCartItems($item); | |
| 212 | $cart->setStatus($status); | |
| 213 | $cart->setItemsQty(0); | |
| 214 | $cart->setItemsCount(1); | |
| 215 |         $cart->setBaseCurrencyCode('code'); | |
| 216 |         $cart->setStoreCurrencyCode('code'); | |
| 217 |         $cart->setQuoteCurrencyCode('usd'); | |
| 218 | $cart->setStoreToBaseRate(12); | |
| 219 | $cart->setStoreToQuoteRate(12); | |
| 220 | $cart->setGrandTotal(2.54); | |
| 221 | $cart->setIsGuest(1); | |
| 222 | $cart->setStore($this->store); | |
| 223 | $cart->setOwner($this->getUser()); | |
| 224 | $cart->setOrganization($this->organization); | |
| 225 | ||
| 226 | $this->em->persist($cart); | |
| 227 | ||
| 228 | return $cart; | |
| 229 | } | |
| 230 | ||
| 231 | /** | |
| 232 | * @param $table | |