How to get product by name attribute Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?Magento 2.1 get custom options for related productsGet custom attribute in category loop?How to Get product id and Sku By product name magento 2..?Magento 2: How to display brand name above product nameGet Regular Price of Configurable Simple ProductHow to change product name in frontendMagento 2: Get Related products from Product Id now showing Name and priceHow to get Sku, name, and image in magento2 in phtml fileHow to remove SKU from product name in search results?How to save stock taking by name product - update quantity by name product
Why not send Voyager 3 and 4 following up the paths taken by Voyager 1 and 2 to re-transmit signals of later as they fly away from Earth?
Getting out of while loop on console
New Order #6: Easter Egg
Why complex landing gears are used instead of simple,reliability and light weight muscle wire or shape memory alloys?
Asymptotics question
What order were files/directories output in dir?
How to ask rejected full-time candidates to apply to teach individual courses?
"klopfte jemand" or "jemand klopfte"?
what is the log of the PDF for a Normal Distribution?
One-one communication
What are the main differences between the original Stargate SG-1 and the Final Cut edition?
Sally's older brother
Moving a wrapfig vertically to encroach partially on a subsection title
Co-worker has annoying ringtone
What is the "studentd" process?
Would color changing eyes affect vision?
I got rid of Mac OSX and replaced it with linux but now I can't change it back to OSX or windows
What initially awakened the Balrog?
Why do early math courses focus on the cross sections of a cone and not on other 3D objects?
Can you force honesty by using the Speak with Dead and Zone of Truth spells together?
Putting class ranking in CV, but against dept guidelines
I can't produce songs
Does the Mueller report show a conspiracy between Russia and the Trump Campaign?
Test print coming out spongy
How to get product by name attribute
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?Magento 2.1 get custom options for related productsGet custom attribute in category loop?How to Get product id and Sku By product name magento 2..?Magento 2: How to display brand name above product nameGet Regular Price of Configurable Simple ProductHow to change product name in frontendMagento 2: Get Related products from Product Id now showing Name and priceHow to get Sku, name, and image in magento2 in phtml fileHow to remove SKU from product name in search results?How to save stock taking by name product - update quantity by name product
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I want get product by sku, name, price.
I do not know how to get it. Please help me. i get it by sku
is success but name or price isn't success.
magento2
add a comment |
I want get product by sku, name, price.
I do not know how to get it. Please help me. i get it by sku
is success but name or price isn't success.
magento2
add a comment |
I want get product by sku, name, price.
I do not know how to get it. Please help me. i get it by sku
is success but name or price isn't success.
magento2
I want get product by sku, name, price.
I do not know how to get it. Please help me. i get it by sku
is success but name or price isn't success.
magento2
magento2
edited 2 days ago
Rv Singh
730418
730418
asked 2 days ago
TN98TN98
487
487
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
you can get product by name or price by using this code
namespace AbdusTestHelper;
class HelperData extends MagentoFrameworkAppHelperAbstractHelper
protected $_productsFactory;
public function __construct(
MagentoCatalogModelResourceModelProductCollectionFactory $productFactory
)
$this->_productsFactory = $productFactory;
public function getProductCollection($productId)
$price = 500;
$name = 'little shirt';
$productCollection = $this->_productsFactory->create()
->addFieldToFilter('price', $price)
->addFieldToFilter('name', $name)
->addAttributeToSelect('*');
return $productCollection;
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%2f270612%2fhow-to-get-product-by-name-attribute%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
you can get product by name or price by using this code
namespace AbdusTestHelper;
class HelperData extends MagentoFrameworkAppHelperAbstractHelper
protected $_productsFactory;
public function __construct(
MagentoCatalogModelResourceModelProductCollectionFactory $productFactory
)
$this->_productsFactory = $productFactory;
public function getProductCollection($productId)
$price = 500;
$name = 'little shirt';
$productCollection = $this->_productsFactory->create()
->addFieldToFilter('price', $price)
->addFieldToFilter('name', $name)
->addAttributeToSelect('*');
return $productCollection;
add a comment |
you can get product by name or price by using this code
namespace AbdusTestHelper;
class HelperData extends MagentoFrameworkAppHelperAbstractHelper
protected $_productsFactory;
public function __construct(
MagentoCatalogModelResourceModelProductCollectionFactory $productFactory
)
$this->_productsFactory = $productFactory;
public function getProductCollection($productId)
$price = 500;
$name = 'little shirt';
$productCollection = $this->_productsFactory->create()
->addFieldToFilter('price', $price)
->addFieldToFilter('name', $name)
->addAttributeToSelect('*');
return $productCollection;
add a comment |
you can get product by name or price by using this code
namespace AbdusTestHelper;
class HelperData extends MagentoFrameworkAppHelperAbstractHelper
protected $_productsFactory;
public function __construct(
MagentoCatalogModelResourceModelProductCollectionFactory $productFactory
)
$this->_productsFactory = $productFactory;
public function getProductCollection($productId)
$price = 500;
$name = 'little shirt';
$productCollection = $this->_productsFactory->create()
->addFieldToFilter('price', $price)
->addFieldToFilter('name', $name)
->addAttributeToSelect('*');
return $productCollection;
you can get product by name or price by using this code
namespace AbdusTestHelper;
class HelperData extends MagentoFrameworkAppHelperAbstractHelper
protected $_productsFactory;
public function __construct(
MagentoCatalogModelResourceModelProductCollectionFactory $productFactory
)
$this->_productsFactory = $productFactory;
public function getProductCollection($productId)
$price = 500;
$name = 'little shirt';
$productCollection = $this->_productsFactory->create()
->addFieldToFilter('price', $price)
->addFieldToFilter('name', $name)
->addAttributeToSelect('*');
return $productCollection;
answered 2 days ago
abdusabdus
3729
3729
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%2f270612%2fhow-to-get-product-by-name-attribute%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