Beispiel #1
0
 /**
  * @test
  */
 public function getSkuWithSkuDelimiterReturnsSkuSetByConstructorWithGivenSkuDelimiter()
 {
     $skuDelimiter = '_';
     $this->beVariant->setSkuDelimiter($skuDelimiter);
     $sku = $this->product->getSku() . $skuDelimiter . $this->sku;
     $this->assertSame($sku, $this->beVariant->getCompleteSku());
 }
Beispiel #2
0
 /**
  * Add CartProduct to Order Item
  *
  * @param \Extcode\Cart\Domain\Model\Cart\Product $cartProduct
  *
  * @return void
  */
 protected function addProduct(\Extcode\Cart\Domain\Model\Cart\Product $cartProduct)
 {
     /**
      * @var \Extcode\Cart\Domain\Model\Order\Product $orderProduct
      */
     $orderProduct = new \Extcode\Cart\Domain\Model\Order\Product($cartProduct->getSku(), $cartProduct->getTitle(), $cartProduct->getQuantity());
     $orderProduct->setPid($this->storagePid);
     $orderProduct->setProductType($cartProduct->getProductType());
     $orderProduct->setPrice($cartProduct->getPrice());
     $orderProduct->setDiscount($cartProduct->getDiscount());
     $orderProduct->setGross($cartProduct->getGross());
     $orderProduct->setNet($cartProduct->getNet());
     $orderProduct->setTaxClass($this->taxClasses[$cartProduct->getTaxClass()->getId()]);
     $orderProduct->setTax($cartProduct->getTax());
     $additionalArray = $cartProduct->getAdditionalArray();
     $data = ['cartProduct' => $cartProduct, 'orderProduct' => &$orderProduct, 'additionalArray' => &$additionalArray, 'storagePid' => $this->storagePid];
     $signalSlotDispatcher = $this->objectManager->get('TYPO3\\CMS\\Extbase\\SignalSlot\\Dispatcher');
     $signalSlotDispatcher->dispatch(__CLASS__, __FUNCTION__ . 'BeforeSetAdditionalData', [$data]);
     $orderProduct->setAdditionalData(json_encode($data['additionalArray']));
     $this->productRepository->add($orderProduct);
     $this->orderItem->addProduct($orderProduct);
     $this->addFeVariants($orderProduct, $cartProduct->getFeVariant());
 }
Beispiel #3
0
 /**
  * @test
  */
 public function setTitleSetsTitle()
 {
     $sku = 'new-test-product-sku';
     $this->product->setSku($sku);
     $this->assertSame($sku, $this->product->getSku());
 }