Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Commit

Permalink
feat(Product): add price field to variant for price selection
Browse files Browse the repository at this point in the history
  • Loading branch information
Jens Schulze committed Nov 11, 2015
1 parent 51f889d commit ea8169e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/Model/Product/ProductVariant.php
Expand Up @@ -10,6 +10,7 @@
use Commercetools\Core\Model\Common\JsonObject;
use Commercetools\Core\Model\Common\LocalizedString;
use Commercetools\Core\Model\Common\PriceCollection;
use Commercetools\Core\Model\Common\Price;

/**
* @package Commercetools\Core\Model\Product
Expand All @@ -26,6 +27,8 @@
* @method ProductVariant setImages(ImageCollection $images = null)
* @method LocalizedString getAvailability()
* @method ProductVariant setAvailability(LocalizedString $availability = null)
* @method Price getPrice()
* @method ProductVariant setPrice(Price $price = null)
*/
class ProductVariant extends JsonObject
{
Expand All @@ -35,6 +38,7 @@ public function fieldDefinitions()
'id' => [static::TYPE => 'string'],
'sku' => [static::TYPE => 'int'],
'prices' => [static::TYPE => '\Commercetools\Core\Model\Common\PriceCollection'],
'price' => [static::TYPE => '\Commercetools\Core\Model\Common\Price'],
'attributes' => [static::TYPE => '\Commercetools\Core\Model\Common\AttributeCollection'],
'images' => [static::TYPE => '\Commercetools\Core\Model\Common\ImageCollection'],
'availability' => [static::TYPE => '\Commercetools\Core\Model\Common\LocalizedString'],
Expand Down
4 changes: 2 additions & 2 deletions src/Request/Products/Command/ProductChangePriceAction.php
Expand Up @@ -18,8 +18,8 @@
* @method ProductChangePriceAction setPrice(PriceDraft $price = null)
* @method bool getStaged()
* @method ProductChangePriceAction setStaged(bool $staged = null)
* @method int getPriceId()
* @method ProductChangePriceAction setPriceId(int $priceId = null)
* @method string getPriceId()
* @method ProductChangePriceAction setPriceId(string $priceId = null)
*/
class ProductChangePriceAction extends AbstractAction
{
Expand Down
Expand Up @@ -13,7 +13,7 @@
*
* @method string getAction()
* @method ProductSetPriceCustomFieldAction setAction(string $action = null)
* @method int getPriceId()
* @method string getPriceId()
* @method ProductSetPriceCustomFieldAction setPriceId(string $priceId = null)
* @method bool getStaged()
* @method ProductSetPriceCustomFieldAction setStaged(bool $staged = null)
Expand Down
Expand Up @@ -18,7 +18,7 @@
* @method ProductSetPriceCustomTypeAction setTypeId(string $typeId = null)
* @method string getTypeKey()
* @method ProductSetPriceCustomTypeAction setTypeKey(string $typeKey = null)
* @method int getPriceId()
* @method string getPriceId()
* @method ProductSetPriceCustomTypeAction setPriceId(string $priceId = null)
* @method bool getStaged()
* @method ProductSetPriceCustomTypeAction setStaged(bool $staged = null)
Expand Down
1 change: 1 addition & 0 deletions tests/fixtures/models.yaml
Expand Up @@ -507,6 +507,7 @@ productVariant:
- id
- sku
- prices
- price
- attributes
- images
- availability
Expand Down

0 comments on commit ea8169e

Please sign in to comment.