Magento 2 API - Get list of products with Catalog Price Rule
We are using Magento 2.1.7 and building some API endpoints to serve our need.
Following is how we get Products list and send them as json from API call.
<?php
namespace VendorCustomerModel;
use MagentoFrameworkApiFilter;
class ProductRepository
{
protected $_productCollection, $productRepository, $searchCriteriaBuilder;
public function __construct(
MagentoCatalogApiProductRepositoryInterface $productRepository,
MagentoFrameworkApiSearchCriteriaBuilder $searchCriteriaBuilder
)
{
$this->productRepository = $productRepository;
$this->searchCriteriaBuilder = $searchCriteriaBuilder;
}
/**
* @return MagentoCatalogApiDataProductSearchResultsInterface
*/
public function getProductCollection()
{
$searchCriteria = $this->searchCriteriaBuilder->create();
$this->_productCollection = $this->productRepository->getList($searchCriteria);
return $this->_productCollection;
}
}
We need to know if we can add some search criteria to getProductCollection() method using Filter to get only those products associated to some active catalog price rule with discounted price.
Or if we have any other method to get Products with Catalog Price Rule and discounted Price, guide me in that direction.
magento2 api product-list catalog-price-rules
add a comment |
We are using Magento 2.1.7 and building some API endpoints to serve our need.
Following is how we get Products list and send them as json from API call.
<?php
namespace VendorCustomerModel;
use MagentoFrameworkApiFilter;
class ProductRepository
{
protected $_productCollection, $productRepository, $searchCriteriaBuilder;
public function __construct(
MagentoCatalogApiProductRepositoryInterface $productRepository,
MagentoFrameworkApiSearchCriteriaBuilder $searchCriteriaBuilder
)
{
$this->productRepository = $productRepository;
$this->searchCriteriaBuilder = $searchCriteriaBuilder;
}
/**
* @return MagentoCatalogApiDataProductSearchResultsInterface
*/
public function getProductCollection()
{
$searchCriteria = $this->searchCriteriaBuilder->create();
$this->_productCollection = $this->productRepository->getList($searchCriteria);
return $this->_productCollection;
}
}
We need to know if we can add some search criteria to getProductCollection() method using Filter to get only those products associated to some active catalog price rule with discounted price.
Or if we have any other method to get Products with Catalog Price Rule and discounted Price, guide me in that direction.
magento2 api product-list catalog-price-rules
not working for me my api call is like 127.0.0.1/Magento/rest/V1/catalogRule/2
– Praveen Negimani
yesterday
add a comment |
We are using Magento 2.1.7 and building some API endpoints to serve our need.
Following is how we get Products list and send them as json from API call.
<?php
namespace VendorCustomerModel;
use MagentoFrameworkApiFilter;
class ProductRepository
{
protected $_productCollection, $productRepository, $searchCriteriaBuilder;
public function __construct(
MagentoCatalogApiProductRepositoryInterface $productRepository,
MagentoFrameworkApiSearchCriteriaBuilder $searchCriteriaBuilder
)
{
$this->productRepository = $productRepository;
$this->searchCriteriaBuilder = $searchCriteriaBuilder;
}
/**
* @return MagentoCatalogApiDataProductSearchResultsInterface
*/
public function getProductCollection()
{
$searchCriteria = $this->searchCriteriaBuilder->create();
$this->_productCollection = $this->productRepository->getList($searchCriteria);
return $this->_productCollection;
}
}
We need to know if we can add some search criteria to getProductCollection() method using Filter to get only those products associated to some active catalog price rule with discounted price.
Or if we have any other method to get Products with Catalog Price Rule and discounted Price, guide me in that direction.
magento2 api product-list catalog-price-rules
We are using Magento 2.1.7 and building some API endpoints to serve our need.
Following is how we get Products list and send them as json from API call.
<?php
namespace VendorCustomerModel;
use MagentoFrameworkApiFilter;
class ProductRepository
{
protected $_productCollection, $productRepository, $searchCriteriaBuilder;
public function __construct(
MagentoCatalogApiProductRepositoryInterface $productRepository,
MagentoFrameworkApiSearchCriteriaBuilder $searchCriteriaBuilder
)
{
$this->productRepository = $productRepository;
$this->searchCriteriaBuilder = $searchCriteriaBuilder;
}
/**
* @return MagentoCatalogApiDataProductSearchResultsInterface
*/
public function getProductCollection()
{
$searchCriteria = $this->searchCriteriaBuilder->create();
$this->_productCollection = $this->productRepository->getList($searchCriteria);
return $this->_productCollection;
}
}
We need to know if we can add some search criteria to getProductCollection() method using Filter to get only those products associated to some active catalog price rule with discounted price.
Or if we have any other method to get Products with Catalog Price Rule and discounted Price, guide me in that direction.
magento2 api product-list catalog-price-rules
magento2 api product-list catalog-price-rules
edited Jul 19 '17 at 6:59
asked Jul 18 '17 at 11:52
mshakeel
321410
321410
not working for me my api call is like 127.0.0.1/Magento/rest/V1/catalogRule/2
– Praveen Negimani
yesterday
add a comment |
not working for me my api call is like 127.0.0.1/Magento/rest/V1/catalogRule/2
– Praveen Negimani
yesterday
not working for me my api call is like 127.0.0.1/Magento/rest/V1/catalogRule/2
– Praveen Negimani
yesterday
not working for me my api call is like 127.0.0.1/Magento/rest/V1/catalogRule/2
– Praveen Negimani
yesterday
add a comment |
1 Answer
1
active
oldest
votes
When you create a catalog price rule, Magento creates some entries in catalogrule_product
table. You can see which products are affected by the price rules created.
Unfortunately ProductRepository
does not allow you to filter by catalog price rule. However, you can modify this class by extending it.
The only thing you need to add is the following line.
$collection->joinTable('catalogrule_product', 'product_id=entity_id', ['product_id'], null, 'inner');
Let's say create MyProductRepository
as follows:
class MyProductRepository extends MagentoCatalogModelProductRepository
{
public function getList(MagentoFrameworkApiSearchCriteriaInterface $searchCriteria)
{
/** @var MagentoCatalogModelResourceModelProductCollection $collection */
$collection = $this->collectionFactory->create();
$this->extensionAttributesJoinProcessor->process($collection);
foreach ($this->metadataService->getList($this->searchCriteriaBuilder->create())->getItems() as $metadata) {
$collection->addAttributeToSelect($metadata->getAttributeCode());
}
$collection->joinTable('catalogrule_product','product_id=entity_id', ['product_id'],null, 'inner');
$collection->joinAttribute('status', 'catalog_product/status', 'entity_id', null, 'inner');
$collection->joinAttribute('visibility', 'catalog_product/visibility', 'entity_id', null, 'inner');
//Add filters from root filter group to the collection
foreach ($searchCriteria->getFilterGroups() as $group) {
$this->addFilterGroupToCollection($group, $collection);
}
/** @var SortOrder $sortOrder */
foreach ((array)$searchCriteria->getSortOrders() as $sortOrder) {
$field = $sortOrder->getField();
$collection->addOrder(
$field,
($sortOrder->getDirection() == SortOrder::SORT_ASC) ? 'ASC' : 'DESC'
);
}
$collection->setCurPage($searchCriteria->getCurrentPage());
$collection->setPageSize($searchCriteria->getPageSize());
$collection->load();
$searchResult = $this->searchResultsFactory->create();
$searchResult->setSearchCriteria($searchCriteria);
$searchResult->setItems($collection->getItems());
$searchResult->setTotalCount($collection->getSize());
return $searchResult;
}
}
Be careful, you cannot use MagentoCatalogApiProductRepositoryInterface
anymore. You have to call your implementation.
$productRepository = $objectManager->get(MyVendorMyModuleModelMyProductRepository::class);
1
Thank you @bunyamin for detailed answer. I have tried this approach and it gets all products with catalog rule price associated. We also need group by product_id in joinTable() as follows:$collection->joinTable('catalogrule_product','product_id=entity_id', ['product_id'],null, 'inner')->getSelect()->group('catalogrule_product.product_id');
– mshakeel
Jul 19 '17 at 6:57
We also need to select it's discounted price on the basis of catalogrule, how can we select extra fields from joined table?
– mshakeel
Jul 19 '17 at 7:06
@mshakeel I think the rule applied prices are stored incatalogrule_product_price
table. You can also join this table.
– Bunyamin Inan
Jul 19 '17 at 12:53
I am returning these products collection from an API call and json returned does not include reduced/special price.
– mshakeel
Jul 19 '17 at 16:31
2
@mshakeel You need to define your interface and include the rule_price. Do not useMagentoCatalogApiDataProductSearchResultsInterface
.
– Bunyamin Inan
Jul 19 '17 at 17:21
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "479"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f184279%2fmagento-2-api-get-list-of-products-with-catalog-price-rule%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
When you create a catalog price rule, Magento creates some entries in catalogrule_product
table. You can see which products are affected by the price rules created.
Unfortunately ProductRepository
does not allow you to filter by catalog price rule. However, you can modify this class by extending it.
The only thing you need to add is the following line.
$collection->joinTable('catalogrule_product', 'product_id=entity_id', ['product_id'], null, 'inner');
Let's say create MyProductRepository
as follows:
class MyProductRepository extends MagentoCatalogModelProductRepository
{
public function getList(MagentoFrameworkApiSearchCriteriaInterface $searchCriteria)
{
/** @var MagentoCatalogModelResourceModelProductCollection $collection */
$collection = $this->collectionFactory->create();
$this->extensionAttributesJoinProcessor->process($collection);
foreach ($this->metadataService->getList($this->searchCriteriaBuilder->create())->getItems() as $metadata) {
$collection->addAttributeToSelect($metadata->getAttributeCode());
}
$collection->joinTable('catalogrule_product','product_id=entity_id', ['product_id'],null, 'inner');
$collection->joinAttribute('status', 'catalog_product/status', 'entity_id', null, 'inner');
$collection->joinAttribute('visibility', 'catalog_product/visibility', 'entity_id', null, 'inner');
//Add filters from root filter group to the collection
foreach ($searchCriteria->getFilterGroups() as $group) {
$this->addFilterGroupToCollection($group, $collection);
}
/** @var SortOrder $sortOrder */
foreach ((array)$searchCriteria->getSortOrders() as $sortOrder) {
$field = $sortOrder->getField();
$collection->addOrder(
$field,
($sortOrder->getDirection() == SortOrder::SORT_ASC) ? 'ASC' : 'DESC'
);
}
$collection->setCurPage($searchCriteria->getCurrentPage());
$collection->setPageSize($searchCriteria->getPageSize());
$collection->load();
$searchResult = $this->searchResultsFactory->create();
$searchResult->setSearchCriteria($searchCriteria);
$searchResult->setItems($collection->getItems());
$searchResult->setTotalCount($collection->getSize());
return $searchResult;
}
}
Be careful, you cannot use MagentoCatalogApiProductRepositoryInterface
anymore. You have to call your implementation.
$productRepository = $objectManager->get(MyVendorMyModuleModelMyProductRepository::class);
1
Thank you @bunyamin for detailed answer. I have tried this approach and it gets all products with catalog rule price associated. We also need group by product_id in joinTable() as follows:$collection->joinTable('catalogrule_product','product_id=entity_id', ['product_id'],null, 'inner')->getSelect()->group('catalogrule_product.product_id');
– mshakeel
Jul 19 '17 at 6:57
We also need to select it's discounted price on the basis of catalogrule, how can we select extra fields from joined table?
– mshakeel
Jul 19 '17 at 7:06
@mshakeel I think the rule applied prices are stored incatalogrule_product_price
table. You can also join this table.
– Bunyamin Inan
Jul 19 '17 at 12:53
I am returning these products collection from an API call and json returned does not include reduced/special price.
– mshakeel
Jul 19 '17 at 16:31
2
@mshakeel You need to define your interface and include the rule_price. Do not useMagentoCatalogApiDataProductSearchResultsInterface
.
– Bunyamin Inan
Jul 19 '17 at 17:21
add a comment |
When you create a catalog price rule, Magento creates some entries in catalogrule_product
table. You can see which products are affected by the price rules created.
Unfortunately ProductRepository
does not allow you to filter by catalog price rule. However, you can modify this class by extending it.
The only thing you need to add is the following line.
$collection->joinTable('catalogrule_product', 'product_id=entity_id', ['product_id'], null, 'inner');
Let's say create MyProductRepository
as follows:
class MyProductRepository extends MagentoCatalogModelProductRepository
{
public function getList(MagentoFrameworkApiSearchCriteriaInterface $searchCriteria)
{
/** @var MagentoCatalogModelResourceModelProductCollection $collection */
$collection = $this->collectionFactory->create();
$this->extensionAttributesJoinProcessor->process($collection);
foreach ($this->metadataService->getList($this->searchCriteriaBuilder->create())->getItems() as $metadata) {
$collection->addAttributeToSelect($metadata->getAttributeCode());
}
$collection->joinTable('catalogrule_product','product_id=entity_id', ['product_id'],null, 'inner');
$collection->joinAttribute('status', 'catalog_product/status', 'entity_id', null, 'inner');
$collection->joinAttribute('visibility', 'catalog_product/visibility', 'entity_id', null, 'inner');
//Add filters from root filter group to the collection
foreach ($searchCriteria->getFilterGroups() as $group) {
$this->addFilterGroupToCollection($group, $collection);
}
/** @var SortOrder $sortOrder */
foreach ((array)$searchCriteria->getSortOrders() as $sortOrder) {
$field = $sortOrder->getField();
$collection->addOrder(
$field,
($sortOrder->getDirection() == SortOrder::SORT_ASC) ? 'ASC' : 'DESC'
);
}
$collection->setCurPage($searchCriteria->getCurrentPage());
$collection->setPageSize($searchCriteria->getPageSize());
$collection->load();
$searchResult = $this->searchResultsFactory->create();
$searchResult->setSearchCriteria($searchCriteria);
$searchResult->setItems($collection->getItems());
$searchResult->setTotalCount($collection->getSize());
return $searchResult;
}
}
Be careful, you cannot use MagentoCatalogApiProductRepositoryInterface
anymore. You have to call your implementation.
$productRepository = $objectManager->get(MyVendorMyModuleModelMyProductRepository::class);
1
Thank you @bunyamin for detailed answer. I have tried this approach and it gets all products with catalog rule price associated. We also need group by product_id in joinTable() as follows:$collection->joinTable('catalogrule_product','product_id=entity_id', ['product_id'],null, 'inner')->getSelect()->group('catalogrule_product.product_id');
– mshakeel
Jul 19 '17 at 6:57
We also need to select it's discounted price on the basis of catalogrule, how can we select extra fields from joined table?
– mshakeel
Jul 19 '17 at 7:06
@mshakeel I think the rule applied prices are stored incatalogrule_product_price
table. You can also join this table.
– Bunyamin Inan
Jul 19 '17 at 12:53
I am returning these products collection from an API call and json returned does not include reduced/special price.
– mshakeel
Jul 19 '17 at 16:31
2
@mshakeel You need to define your interface and include the rule_price. Do not useMagentoCatalogApiDataProductSearchResultsInterface
.
– Bunyamin Inan
Jul 19 '17 at 17:21
add a comment |
When you create a catalog price rule, Magento creates some entries in catalogrule_product
table. You can see which products are affected by the price rules created.
Unfortunately ProductRepository
does not allow you to filter by catalog price rule. However, you can modify this class by extending it.
The only thing you need to add is the following line.
$collection->joinTable('catalogrule_product', 'product_id=entity_id', ['product_id'], null, 'inner');
Let's say create MyProductRepository
as follows:
class MyProductRepository extends MagentoCatalogModelProductRepository
{
public function getList(MagentoFrameworkApiSearchCriteriaInterface $searchCriteria)
{
/** @var MagentoCatalogModelResourceModelProductCollection $collection */
$collection = $this->collectionFactory->create();
$this->extensionAttributesJoinProcessor->process($collection);
foreach ($this->metadataService->getList($this->searchCriteriaBuilder->create())->getItems() as $metadata) {
$collection->addAttributeToSelect($metadata->getAttributeCode());
}
$collection->joinTable('catalogrule_product','product_id=entity_id', ['product_id'],null, 'inner');
$collection->joinAttribute('status', 'catalog_product/status', 'entity_id', null, 'inner');
$collection->joinAttribute('visibility', 'catalog_product/visibility', 'entity_id', null, 'inner');
//Add filters from root filter group to the collection
foreach ($searchCriteria->getFilterGroups() as $group) {
$this->addFilterGroupToCollection($group, $collection);
}
/** @var SortOrder $sortOrder */
foreach ((array)$searchCriteria->getSortOrders() as $sortOrder) {
$field = $sortOrder->getField();
$collection->addOrder(
$field,
($sortOrder->getDirection() == SortOrder::SORT_ASC) ? 'ASC' : 'DESC'
);
}
$collection->setCurPage($searchCriteria->getCurrentPage());
$collection->setPageSize($searchCriteria->getPageSize());
$collection->load();
$searchResult = $this->searchResultsFactory->create();
$searchResult->setSearchCriteria($searchCriteria);
$searchResult->setItems($collection->getItems());
$searchResult->setTotalCount($collection->getSize());
return $searchResult;
}
}
Be careful, you cannot use MagentoCatalogApiProductRepositoryInterface
anymore. You have to call your implementation.
$productRepository = $objectManager->get(MyVendorMyModuleModelMyProductRepository::class);
When you create a catalog price rule, Magento creates some entries in catalogrule_product
table. You can see which products are affected by the price rules created.
Unfortunately ProductRepository
does not allow you to filter by catalog price rule. However, you can modify this class by extending it.
The only thing you need to add is the following line.
$collection->joinTable('catalogrule_product', 'product_id=entity_id', ['product_id'], null, 'inner');
Let's say create MyProductRepository
as follows:
class MyProductRepository extends MagentoCatalogModelProductRepository
{
public function getList(MagentoFrameworkApiSearchCriteriaInterface $searchCriteria)
{
/** @var MagentoCatalogModelResourceModelProductCollection $collection */
$collection = $this->collectionFactory->create();
$this->extensionAttributesJoinProcessor->process($collection);
foreach ($this->metadataService->getList($this->searchCriteriaBuilder->create())->getItems() as $metadata) {
$collection->addAttributeToSelect($metadata->getAttributeCode());
}
$collection->joinTable('catalogrule_product','product_id=entity_id', ['product_id'],null, 'inner');
$collection->joinAttribute('status', 'catalog_product/status', 'entity_id', null, 'inner');
$collection->joinAttribute('visibility', 'catalog_product/visibility', 'entity_id', null, 'inner');
//Add filters from root filter group to the collection
foreach ($searchCriteria->getFilterGroups() as $group) {
$this->addFilterGroupToCollection($group, $collection);
}
/** @var SortOrder $sortOrder */
foreach ((array)$searchCriteria->getSortOrders() as $sortOrder) {
$field = $sortOrder->getField();
$collection->addOrder(
$field,
($sortOrder->getDirection() == SortOrder::SORT_ASC) ? 'ASC' : 'DESC'
);
}
$collection->setCurPage($searchCriteria->getCurrentPage());
$collection->setPageSize($searchCriteria->getPageSize());
$collection->load();
$searchResult = $this->searchResultsFactory->create();
$searchResult->setSearchCriteria($searchCriteria);
$searchResult->setItems($collection->getItems());
$searchResult->setTotalCount($collection->getSize());
return $searchResult;
}
}
Be careful, you cannot use MagentoCatalogApiProductRepositoryInterface
anymore. You have to call your implementation.
$productRepository = $objectManager->get(MyVendorMyModuleModelMyProductRepository::class);
answered Jul 18 '17 at 17:33
Bunyamin Inan
842624
842624
1
Thank you @bunyamin for detailed answer. I have tried this approach and it gets all products with catalog rule price associated. We also need group by product_id in joinTable() as follows:$collection->joinTable('catalogrule_product','product_id=entity_id', ['product_id'],null, 'inner')->getSelect()->group('catalogrule_product.product_id');
– mshakeel
Jul 19 '17 at 6:57
We also need to select it's discounted price on the basis of catalogrule, how can we select extra fields from joined table?
– mshakeel
Jul 19 '17 at 7:06
@mshakeel I think the rule applied prices are stored incatalogrule_product_price
table. You can also join this table.
– Bunyamin Inan
Jul 19 '17 at 12:53
I am returning these products collection from an API call and json returned does not include reduced/special price.
– mshakeel
Jul 19 '17 at 16:31
2
@mshakeel You need to define your interface and include the rule_price. Do not useMagentoCatalogApiDataProductSearchResultsInterface
.
– Bunyamin Inan
Jul 19 '17 at 17:21
add a comment |
1
Thank you @bunyamin for detailed answer. I have tried this approach and it gets all products with catalog rule price associated. We also need group by product_id in joinTable() as follows:$collection->joinTable('catalogrule_product','product_id=entity_id', ['product_id'],null, 'inner')->getSelect()->group('catalogrule_product.product_id');
– mshakeel
Jul 19 '17 at 6:57
We also need to select it's discounted price on the basis of catalogrule, how can we select extra fields from joined table?
– mshakeel
Jul 19 '17 at 7:06
@mshakeel I think the rule applied prices are stored incatalogrule_product_price
table. You can also join this table.
– Bunyamin Inan
Jul 19 '17 at 12:53
I am returning these products collection from an API call and json returned does not include reduced/special price.
– mshakeel
Jul 19 '17 at 16:31
2
@mshakeel You need to define your interface and include the rule_price. Do not useMagentoCatalogApiDataProductSearchResultsInterface
.
– Bunyamin Inan
Jul 19 '17 at 17:21
1
1
Thank you @bunyamin for detailed answer. I have tried this approach and it gets all products with catalog rule price associated. We also need group by product_id in joinTable() as follows:
$collection->joinTable('catalogrule_product','product_id=entity_id', ['product_id'],null, 'inner')->getSelect()->group('catalogrule_product.product_id');
– mshakeel
Jul 19 '17 at 6:57
Thank you @bunyamin for detailed answer. I have tried this approach and it gets all products with catalog rule price associated. We also need group by product_id in joinTable() as follows:
$collection->joinTable('catalogrule_product','product_id=entity_id', ['product_id'],null, 'inner')->getSelect()->group('catalogrule_product.product_id');
– mshakeel
Jul 19 '17 at 6:57
We also need to select it's discounted price on the basis of catalogrule, how can we select extra fields from joined table?
– mshakeel
Jul 19 '17 at 7:06
We also need to select it's discounted price on the basis of catalogrule, how can we select extra fields from joined table?
– mshakeel
Jul 19 '17 at 7:06
@mshakeel I think the rule applied prices are stored in
catalogrule_product_price
table. You can also join this table.– Bunyamin Inan
Jul 19 '17 at 12:53
@mshakeel I think the rule applied prices are stored in
catalogrule_product_price
table. You can also join this table.– Bunyamin Inan
Jul 19 '17 at 12:53
I am returning these products collection from an API call and json returned does not include reduced/special price.
– mshakeel
Jul 19 '17 at 16:31
I am returning these products collection from an API call and json returned does not include reduced/special price.
– mshakeel
Jul 19 '17 at 16:31
2
2
@mshakeel You need to define your interface and include the rule_price. Do not use
MagentoCatalogApiDataProductSearchResultsInterface
.– Bunyamin Inan
Jul 19 '17 at 17:21
@mshakeel You need to define your interface and include the rule_price. Do not use
MagentoCatalogApiDataProductSearchResultsInterface
.– Bunyamin Inan
Jul 19 '17 at 17:21
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f184279%2fmagento-2-api-get-list-of-products-with-catalog-price-rule%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
not working for me my api call is like 127.0.0.1/Magento/rest/V1/catalogRule/2
– Praveen Negimani
yesterday