Esempio n. 1
0
 /**
  * @return \Generated\Shared\Transfer\QuoteTransfer
  */
 private function getValidBaseQuoteTransfer()
 {
     $country = new SpyCountry();
     $country->setIso2Code('ix');
     $country->save();
     $quoteTransfer = new QuoteTransfer();
     $billingAddress = new AddressTransfer();
     $billingAddress->setIso2Code('ix')->setAddress1('address-1-1-test')->setFirstName('Max')->setLastName('Mustermann')->setZipCode('1337')->setCity('SpryHome');
     $shippingAddress = new AddressTransfer();
     $shippingAddress->setIso2Code('ix')->setAddress1('address-1-2-test')->setFirstName('Max')->setLastName('Mustermann')->setZipCode('1337')->setCity('SpryHome');
     $totals = new TotalsTransfer();
     $totals->setGrandTotal(1337)->setSubtotal(337);
     $quoteTransfer->setShippingAddress($shippingAddress)->setBillingAddress($billingAddress)->setTotals($totals);
     $customerTransfer = new CustomerTransfer();
     $customerTransfer->setEmail('*****@*****.**');
     $customerTransfer->setFirstName('Max');
     $customerTransfer->setLastName('Mustermann');
     $quoteTransfer->setCustomer($customerTransfer);
     $shipmentTransfer = new ShipmentTransfer();
     $shipmentTransfer->setMethod(new ShipmentMethodTransfer());
     $quoteTransfer->setShipment($shipmentTransfer);
     $itemTransfer = new ItemTransfer();
     $itemTransfer->setUnitGrossPrice(1)->setQuantity(1)->setName('test-name')->setSku('sku-test');
     $quoteTransfer->addItem($itemTransfer);
     $paymentTransfer = new PaymentTransfer();
     $paymentTransfer->setPaymentSelection('dummyPaymentInvoice');
     $quoteTransfer->setPayment($paymentTransfer);
     return $quoteTransfer;
 }
Esempio n. 2
0
 /**
  * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
  * @param \Generated\Shared\Transfer\CustomerTransfer $customerTransfer
  *
  * @return void
  */
 protected function hydrateCustomerTransfer(QuoteTransfer $quoteTransfer, CustomerTransfer $customerTransfer)
 {
     $customerTransfer->setFirstName($quoteTransfer->getBillingAddress()->getFirstName());
     $customerTransfer->setLastName($quoteTransfer->getBillingAddress()->getLastName());
     if ($customerTransfer->getEmail() === null) {
         $customerTransfer->setEmail($quoteTransfer->getBillingAddress()->getEmail());
     }
 }