Skip to content

Commit

Permalink
Merge pull request #19 from Plasma-Platform/feature/TMONE-894/checkout
Browse files Browse the repository at this point in the history
TMONE-894 - add product additional info
  • Loading branch information
dimanovoseltsev authored Feb 5, 2025
2 parents 01a3fe0 + 3296f3e commit 85e0822
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 22 deletions.
39 changes: 39 additions & 0 deletions src/API2Client/Entities/Order/Additional/ProductInfo.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

namespace API2Client\Entities\Order\Additional;

class ProductInfo implements AdditionalInfoInterface
{
/**
* @var string
*/
protected $orderId;


/**
* @param string $orderId
*/
public function setOrderId($orderId)
{
$this->orderId = $orderId;
}

/**
* @return string
*/
public function getOrderId()
{
return $this->orderId;
}


/**
* @return array
*/
public function toArray()
{
return array_filter(array(
'order_id' => $this->getOrderId(),
));
}
}
47 changes: 25 additions & 22 deletions src/API2Client/Entities/Order/Additional/ProductOffer.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace API2Client\Entities\Order\Additional;


class ProductOffer implements AdditionalInfoInterface
class ProductOffer extends ProductInfo
{
/**
* @var int
Expand Down Expand Up @@ -45,111 +45,114 @@ class ProductOffer implements AdditionalInfoInterface
/**
* @param int $channelId
*/
public function setChannelId ($channelId)
public function setChannelId($channelId)
{
$this->channelId = $channelId;
}

/**
* @return int
*/
public function getChannelId ()
public function getChannelId()
{
return $this->channelId;
}

/**
* @param int $offerPercentDiscount
*/
public function setOfferPercentDiscount ($offerPercentDiscount)
public function setOfferPercentDiscount($offerPercentDiscount)
{
$this->offerPercentDiscount = $offerPercentDiscount;
}

/**
* @return int
*/
public function getOfferPercentDiscount ()
public function getOfferPercentDiscount()
{
return $this->offerPercentDiscount;
}

/**
* @param int $position
*/
public function setPosition ($position)
public function setPosition($position)
{
$this->position = $position;
}

/**
* @return int
*/
public function getPosition ()
public function getPosition()
{
return $this->position;
}

/**
* @param int $presentationId
*/
public function setPresentationId ($presentationId)
public function setPresentationId($presentationId)
{
$this->presentationId = $presentationId;
}

/**
* @return int
*/
public function getPresentationId ()
public function getPresentationId()
{
return $this->presentationId;
}

/**
* @param int $searchContextId
*/
public function setSearchContextId ($searchContextId)
public function setSearchContextId($searchContextId)
{
$this->searchContextId = $searchContextId;
}

/**
* @return int
*/
public function getSearchContextId ()
public function getSearchContextId()
{
return $this->searchContextId;
}

/**
* @param int $templateId
*/
public function setTemplateId ($templateId)
public function setTemplateId($templateId)
{
$this->templateId = $templateId;
}

/**
* @return int
*/
public function getTemplateId ()
public function getTemplateId()
{
return $this->templateId;
}

/**
* @return array
*/
public function toArray ()
public function toArray()
{
return array (
'channelId' => $this->getChannelId (),
'offerPercentDiscount' => $this->getOfferPercentDiscount (),
'position' => $this->getPosition (),
'presentationId' => $this->getPresentationId (),
'searchContextId' => $this->getSearchContextId (),
'templateId' => $this->getTemplateId (),
return array_merge(
parent::toArray(),
array(
'channelId' => $this->getChannelId(),
'offerPercentDiscount' => $this->getOfferPercentDiscount(),
'position' => $this->getPosition(),
'presentationId' => $this->getPresentationId(),
'searchContextId' => $this->getSearchContextId(),
'templateId' => $this->getTemplateId(),
)
);
}
}
}

0 comments on commit 85e0822

Please sign in to comment.