-
Notifications
You must be signed in to change notification settings - Fork 8
[FEATURE] Added addon prices to products api #335
Conversation
6cf6af2
to
27712e6
Compare
27712e6
to
1bc25c2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests failing
* @param string $locale | ||
* @param PriceFormatter $priceFormatter | ||
*/ | ||
public function __construct( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should fit into a single line
); | ||
$apiAddon->setAddonPrices(iterator_to_array($addon->getAddonPrices())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not passing to to the function call? maybe with default value?
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function createAddonProductApiEntity(ProductInterface $product, $locale) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add prices with default value[]
. and to the constructor.
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function setAddonPrices(array $addonPrices) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add this to the constructor and remove this function.
b269359
to
37fc1fc
Compare
What's in this PR?
In this PR, addon-prices are introduced to products api. Before this PR you were able to define prices for Product-Addon relations but could not derive them through an API call.
Example Usage
yourdomain.com/admin/api/products/id
BC Breaks/Deprecations
createAddonProductApiEntity
ProductFactory
to be passed to the constructor.