I need to add a extra field in product rest api response - Magento 2How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlFiltering product list by extension attributemain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 Add new field to Magento_User admin formMagento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 Can't view module's front end page output?
Is there a way to get `mathscr' with lower case letters in pdfLaTeX?
Biological Blimps: Propulsion
Redundant comparison & "if" before assignment
How much character growth crosses the line into breaking the character
Is there an injective, monotonically increasing, strictly concave function from the reals, to the reals?
What's the difference between releasing hormones and tropic hormones?
Limits and Infinite Integration by Parts
How could a planet have erratic days?
What happens if you are holding an Iron Flask with a demon inside and walk into an Antimagic Field?
What is going on with 'gets(stdin)' on the site coderbyte?
Pre-mixing cryogenic fuels and using only one fuel tank
Why does AES have exactly 10 rounds for a 128-bit key, 12 for 192 bits and 14 for a 256-bit key size?
Can a Canadian Travel to the USA twice, less than 180 days each time?
Why is the "ls" command showing permissions of files in a FAT32 partition?
15% tax on $7.5k earnings. Is that right?
Can disgust be a key component of horror?
Why "had" in "[something] we would have made had we used [something]"?
What are the advantages of simplicial model categories over non-simplicial ones?
What is Cash Advance APR?
How can I write humor as character trait?
Angel of Condemnation - Exile creature with second ability
Non-trope happy ending?
What does "Scientists rise up against statistical significance" mean? (Comment in Nature)
What should you do when eye contact makes your subordinate uncomfortable?
I need to add a extra field in product rest api response - Magento 2
How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlFiltering product list by extension attributemain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 Add new field to Magento_User admin formMagento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 Can't view module's front end page output?
I want to add a field "slider" in /rest/V1/products/:sku
I created a custom module and in my di.xml i have added the following code
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="MagentoCatalogModelProduct" type="mymodCatalogModelProduct" />
<preference for="mymodCatalogApiDataProductInterface" type="mymodCatalogModelProduct" />
<preference for="mymodCatalogApiProductRepositoryInterface" type="MagentoCatalogApiProductRepositoryInterface" />
<preference for="mymodCatalogApiDataProductInterface" type="MagentoCatalogApiDataProductInterface" />
</config>
And I have added a method to Api/Data/ProductInterface
const slider = 'slider';
public function getSlider();
public function setSlider($slider);
I have implemented the two methods in
<?php
namespace mymodCatalogModel;
class Product extends MagentoCatalogModelProduct implements AugmentesCatalogApiDataProductInterface
/**
* @inheritdoc
*/
public function getSlider()
return "test";
/**
* Set slider value
*
* @param string $slider
* @return $this
*/
public function setSlider($slider)
return $this->setData('slider', "");
I also extended the ProductRepositoryInterface
changed the routes in webapi.xml
Still the field not coming in response. Anyone please advise.
Thanks.
magento2 module rest slider
bumped to the homepage by Community♦ yesterday
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
I want to add a field "slider" in /rest/V1/products/:sku
I created a custom module and in my di.xml i have added the following code
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="MagentoCatalogModelProduct" type="mymodCatalogModelProduct" />
<preference for="mymodCatalogApiDataProductInterface" type="mymodCatalogModelProduct" />
<preference for="mymodCatalogApiProductRepositoryInterface" type="MagentoCatalogApiProductRepositoryInterface" />
<preference for="mymodCatalogApiDataProductInterface" type="MagentoCatalogApiDataProductInterface" />
</config>
And I have added a method to Api/Data/ProductInterface
const slider = 'slider';
public function getSlider();
public function setSlider($slider);
I have implemented the two methods in
<?php
namespace mymodCatalogModel;
class Product extends MagentoCatalogModelProduct implements AugmentesCatalogApiDataProductInterface
/**
* @inheritdoc
*/
public function getSlider()
return "test";
/**
* Set slider value
*
* @param string $slider
* @return $this
*/
public function setSlider($slider)
return $this->setData('slider', "");
I also extended the ProductRepositoryInterface
changed the routes in webapi.xml
Still the field not coming in response. Anyone please advise.
Thanks.
magento2 module rest slider
bumped to the homepage by Community♦ yesterday
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
any clue how to solve this ? I've got the same problem
– Gujarat Santana
Oct 2 '17 at 9:00
add a comment |
I want to add a field "slider" in /rest/V1/products/:sku
I created a custom module and in my di.xml i have added the following code
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="MagentoCatalogModelProduct" type="mymodCatalogModelProduct" />
<preference for="mymodCatalogApiDataProductInterface" type="mymodCatalogModelProduct" />
<preference for="mymodCatalogApiProductRepositoryInterface" type="MagentoCatalogApiProductRepositoryInterface" />
<preference for="mymodCatalogApiDataProductInterface" type="MagentoCatalogApiDataProductInterface" />
</config>
And I have added a method to Api/Data/ProductInterface
const slider = 'slider';
public function getSlider();
public function setSlider($slider);
I have implemented the two methods in
<?php
namespace mymodCatalogModel;
class Product extends MagentoCatalogModelProduct implements AugmentesCatalogApiDataProductInterface
/**
* @inheritdoc
*/
public function getSlider()
return "test";
/**
* Set slider value
*
* @param string $slider
* @return $this
*/
public function setSlider($slider)
return $this->setData('slider', "");
I also extended the ProductRepositoryInterface
changed the routes in webapi.xml
Still the field not coming in response. Anyone please advise.
Thanks.
magento2 module rest slider
I want to add a field "slider" in /rest/V1/products/:sku
I created a custom module and in my di.xml i have added the following code
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="MagentoCatalogModelProduct" type="mymodCatalogModelProduct" />
<preference for="mymodCatalogApiDataProductInterface" type="mymodCatalogModelProduct" />
<preference for="mymodCatalogApiProductRepositoryInterface" type="MagentoCatalogApiProductRepositoryInterface" />
<preference for="mymodCatalogApiDataProductInterface" type="MagentoCatalogApiDataProductInterface" />
</config>
And I have added a method to Api/Data/ProductInterface
const slider = 'slider';
public function getSlider();
public function setSlider($slider);
I have implemented the two methods in
<?php
namespace mymodCatalogModel;
class Product extends MagentoCatalogModelProduct implements AugmentesCatalogApiDataProductInterface
/**
* @inheritdoc
*/
public function getSlider()
return "test";
/**
* Set slider value
*
* @param string $slider
* @return $this
*/
public function setSlider($slider)
return $this->setData('slider', "");
I also extended the ProductRepositoryInterface
changed the routes in webapi.xml
Still the field not coming in response. Anyone please advise.
Thanks.
magento2 module rest slider
magento2 module rest slider
edited Jul 13 '17 at 10:48
meena
asked Jul 10 '17 at 12:57
meenameena
212
212
bumped to the homepage by Community♦ yesterday
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ yesterday
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
any clue how to solve this ? I've got the same problem
– Gujarat Santana
Oct 2 '17 at 9:00
add a comment |
any clue how to solve this ? I've got the same problem
– Gujarat Santana
Oct 2 '17 at 9:00
any clue how to solve this ? I've got the same problem
– Gujarat Santana
Oct 2 '17 at 9:00
any clue how to solve this ? I've got the same problem
– Gujarat Santana
Oct 2 '17 at 9:00
add a comment |
1 Answer
1
active
oldest
votes
methods to test your code.
first check which api is getting called, your or default magento by putting some die in middle of code.
if it is coming from default then check your di.xml
if it is from your code make sure you deleted all cache and run setup-upgrade and static-content:deploy as well.
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%2f182932%2fi-need-to-add-a-extra-field-in-product-rest-api-response-magento-2%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
methods to test your code.
first check which api is getting called, your or default magento by putting some die in middle of code.
if it is coming from default then check your di.xml
if it is from your code make sure you deleted all cache and run setup-upgrade and static-content:deploy as well.
add a comment |
methods to test your code.
first check which api is getting called, your or default magento by putting some die in middle of code.
if it is coming from default then check your di.xml
if it is from your code make sure you deleted all cache and run setup-upgrade and static-content:deploy as well.
add a comment |
methods to test your code.
first check which api is getting called, your or default magento by putting some die in middle of code.
if it is coming from default then check your di.xml
if it is from your code make sure you deleted all cache and run setup-upgrade and static-content:deploy as well.
methods to test your code.
first check which api is getting called, your or default magento by putting some die in middle of code.
if it is coming from default then check your di.xml
if it is from your code make sure you deleted all cache and run setup-upgrade and static-content:deploy as well.
answered Jul 13 '17 at 11:53
ravichandraravichandra
7917
7917
add a comment |
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.
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%2f182932%2fi-need-to-add-a-extra-field-in-product-rest-api-response-magento-2%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
any clue how to solve this ? I've got the same problem
– Gujarat Santana
Oct 2 '17 at 9:00