Exemple #1
0
 /**
  * @param \Generated\Shared\Transfer\ItemTransfer $cartItem
  *
  * @return string
  */
 protected function buildGroupKey(ItemTransfer $cartItem)
 {
     $groupKey = $cartItem->getGroupKey();
     if (empty($groupKey)) {
         return $cartItem->getSku();
     }
     return $groupKey;
 }
 /**
  * @param \Generated\Shared\Transfer\ItemTransfer $item
  *
  * @return string
  */
 protected function buildGroupKey(ItemTransfer $item)
 {
     $currentGroupKey = $item->getGroupKey();
     if (!$item->getProductOptions()) {
         return $currentGroupKey;
     }
     $sortedProductOptions = $this->sortOptions((array) $item->getProductOptions());
     $optionGroupKey = $this->combineOptionParts($sortedProductOptions);
     if (empty($optionGroupKey)) {
         return $currentGroupKey;
     }
     return !empty($currentGroupKey) ? $currentGroupKey . '-' . $optionGroupKey : $optionGroupKey;
 }
 /**
  * @param \Generated\Shared\Transfer\ItemTransfer $orderItem
  *
  * @return \Generated\Shared\Transfer\RefundItemTransfer
  */
 protected function createRefundItem(ItemTransfer $orderItem)
 {
     $refundItem = new RefundItemTransfer();
     $refundItem->setFkSalesOrderItem($orderItem->getIdSalesOrderItem());
     $refundItem->setQuantity($orderItem->getQuantity());
     $refundItem->setGrossPrice($orderItem->getUnitGrossPrice());
     $refundItem->setDiscountAmount($orderItem->getSumTotalDiscountAmount());
     $refundItem->setName($orderItem->getName());
     $refundItem->setGroupKey($orderItem->getGroupKey());
     $refundItem->setTaxRate($orderItem->getTaxRate());
     $refundItem->setTaxAmount($orderItem->getSumTaxAmount());
     return $refundItem;
 }
 /**
  * @param \Generated\Shared\Transfer\ItemTransfer $itemTransfer
  *
  * @return string
  */
 protected function getItemIdentifier(ItemTransfer $itemTransfer)
 {
     return $itemTransfer->getGroupKey() ? $itemTransfer->getGroupKey() : $itemTransfer->getSku();
 }
Exemple #5
0
 /**
  * @param \Generated\Shared\Transfer\ItemTransfer $wishlistItemTransfer
  * @param int $idWishlist
  *
  * @return \Orm\Zed\Wishlist\Persistence\SpyWishlistItem|null
  */
 protected function getWishlistItemEntity(ItemTransfer $wishlistItemTransfer, $idWishlist)
 {
     $wishlistItemEntity = null;
     if ($wishlistItemTransfer->getGroupKey()) {
         $wishlistItemEntity = $this->wishlistQueryContainer->queryCustomerWishlistByGroupKey($idWishlist, $wishlistItemTransfer->getGroupKey())->findOne();
     }
     if (empty($wishlistItemEntity)) {
         $idProductConcrete = $this->facadeProduct->getProductConcreteIdBySku($wishlistItemTransfer->getSku());
         $wishlistItemEntity = $this->wishlistQueryContainer->queryCustomerWishlistByProductId($idWishlist, $idProductConcrete)->findOne();
     }
     return $wishlistItemEntity;
 }