What are other possible functions i can accessModify Product page UI with custom HTML body and load the dataWhat are the possible Argument Namespaces for LogosWhat are the Dispatch/Execute() functions and how do they work?What are magento2 blacklists?Magento 2 - what functions can I use?Problem with product image cache after upgradeHow to access other UI componentsWhat are the features and functions of Magento Cloud?Magento 2 get custom attribute of a single product inside a pluginWhat features are enterprise and what are free when looking at user guide?Magento 2 : Access ko observable variable into other js file
Can the word "desk" be used as a verb?
Intern not wearing safety equipment; how could I have handled this differently?
Why won't the U.S. sign a peace treaty with North Korea?
Can Jimmy hang on his rope?
How should I ask for a "pint" in countries that use metric?
What was the nature of the known bugs in the Space Shuttle software?
Can a landlord force all residents to use the landlord's in-house debit card accounts?
My professor has told me he will be the corresponding author. Will it hurt my future career?
How was the website able to tell my credit card was wrong before it processed it?
Why is a mixture of two normally distributed variables only bimodal if their means differ by at least two times the common standard deviation?
Did depressed people far more accurately estimate how many monsters they killed in a video game?
As a supervisor, what feedback would you expect from a PhD who quits?
Findminimum of Integral
Why do people prefer metropolitan areas, considering monsters and villains?
Is there an In-Universe reason why Thor and the Asgardians think Rocket is a rabbit?
Other Space Shuttle O-ring failures
Was it ever illegal to name a pig "Napoleon" in France?
Long exposures create red noisy glow.. but only with one of my lenses. Why?
How do I explain that I don't want to maintain old projects?
How many Jimmys can fit?
How to "add vert" in blender 2.8?
How to convert diagonal matrix to rectangular matrix
This LM317 diagram doesn't make any sense to me
My previous employer committed a severe violation of the law and is also being sued by me. How do I explain the situation to future employers?
What are other possible functions i can access
Modify Product page UI with custom HTML body and load the dataWhat are the possible Argument Namespaces for LogosWhat are the Dispatch/Execute() functions and how do they work?What are magento2 blacklists?Magento 2 - what functions can I use?Problem with product image cache after upgradeHow to access other UI componentsWhat are the features and functions of Magento Cloud?Magento 2 get custom attribute of a single product inside a pluginWhat features are enterprise and what are free when looking at user guide?Magento 2 : Access ko observable variable into other js file
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I created placed custom html in Magento_Catalog>template>product>view>details.phtml
file in Magento_Catalog
module and added below code to get current product ID and name
$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$product = $objectManager->get('MagentoFrameworkRegistry')->registry('current_product');
$_product_id = $product->getId();
$_product_name = $product->getName();
What are the other functions to get product details like Price, Images, Short & Long description, etc...
Please sugest me the list of functions i can use to get product details.
Please help me if you know answer to this Question also
magento2 product-images product-view magento-catalog product-details
add a comment |
I created placed custom html in Magento_Catalog>template>product>view>details.phtml
file in Magento_Catalog
module and added below code to get current product ID and name
$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$product = $objectManager->get('MagentoFrameworkRegistry')->registry('current_product');
$_product_id = $product->getId();
$_product_name = $product->getName();
What are the other functions to get product details like Price, Images, Short & Long description, etc...
Please sugest me the list of functions i can use to get product details.
Please help me if you know answer to this Question also
magento2 product-images product-view magento-catalog product-details
1
You can take reference from this file for get product detailsmagento/vendor/magento/module-catalog/view/frontend/templates/product/list.phtml
– Pragnadeep Pitroda
Jun 29 at 17:17
add a comment |
I created placed custom html in Magento_Catalog>template>product>view>details.phtml
file in Magento_Catalog
module and added below code to get current product ID and name
$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$product = $objectManager->get('MagentoFrameworkRegistry')->registry('current_product');
$_product_id = $product->getId();
$_product_name = $product->getName();
What are the other functions to get product details like Price, Images, Short & Long description, etc...
Please sugest me the list of functions i can use to get product details.
Please help me if you know answer to this Question also
magento2 product-images product-view magento-catalog product-details
I created placed custom html in Magento_Catalog>template>product>view>details.phtml
file in Magento_Catalog
module and added below code to get current product ID and name
$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$product = $objectManager->get('MagentoFrameworkRegistry')->registry('current_product');
$_product_id = $product->getId();
$_product_name = $product->getName();
What are the other functions to get product details like Price, Images, Short & Long description, etc...
Please sugest me the list of functions i can use to get product details.
Please help me if you know answer to this Question also
magento2 product-images product-view magento-catalog product-details
magento2 product-images product-view magento-catalog product-details
asked Jun 29 at 15:29
rakcoderakcode
1034 bronze badges
1034 bronze badges
1
You can take reference from this file for get product detailsmagento/vendor/magento/module-catalog/view/frontend/templates/product/list.phtml
– Pragnadeep Pitroda
Jun 29 at 17:17
add a comment |
1
You can take reference from this file for get product detailsmagento/vendor/magento/module-catalog/view/frontend/templates/product/list.phtml
– Pragnadeep Pitroda
Jun 29 at 17:17
1
1
You can take reference from this file for get product details
magento/vendor/magento/module-catalog/view/frontend/templates/product/list.phtml
– Pragnadeep Pitroda
Jun 29 at 17:17
You can take reference from this file for get product details
magento/vendor/magento/module-catalog/view/frontend/templates/product/list.phtml
– Pragnadeep Pitroda
Jun 29 at 17:17
add a comment |
3 Answers
3
active
oldest
votes
You can get price,sku,description by following code
$_product_price = $product->getPrice();
$_product_image= $product->getImage();
$_product_sku = $product->getSku();
$_product_desc=$product->getDescription();
updated solution
get category ids and images by following code
protected $_productRepositoryFactory;
public function __construct(
MagentoCatalogApiProductRepositoryInterfaceFactory $productRepositoryFactory
)
$this->_productRepositoryFactory = $productRepositoryFactory;
In function
$_items = $order->getAllItems();
foreach($_items as $_item)
$id=$_item->getProductId();
$product = $this->_productRepositoryFactory->create()->getById($item->getProductId());
$product->getData('image');
$product->getData('thumbnail');
$product->getData('small_image');
$product->getCategoryIds();
1
Did you try this?
– MSA
Jul 2 at 6:31
I'll try that. how can we get images of the same product? getGallery??? and category also? getCategory?
– rakcode
Jul 3 at 10:32
Thanks. Can you please check my another question. no one replied to me on that one! :(
– rakcode
Jul 3 at 11:15
1
Did you check updated answer?
– MSA
Jul 3 at 11:16
Yes its working fine for me. Thanks.
– rakcode
Jul 3 at 12:56
add a comment |
You current_product is the object of following class:
MagentoCatalogModelProduct
Path:
vendor/magento/module-catalog/Model/Product.php
Now you open this class and search your actual method.
add a comment |
Following code will list you a functions list to get product data according to your code.
echo "<pre>";
var_dump(get_class_methods($product));
Hope it helps.
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%2f280190%2fwhat-are-other-possible-functions-i-can-access%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can get price,sku,description by following code
$_product_price = $product->getPrice();
$_product_image= $product->getImage();
$_product_sku = $product->getSku();
$_product_desc=$product->getDescription();
updated solution
get category ids and images by following code
protected $_productRepositoryFactory;
public function __construct(
MagentoCatalogApiProductRepositoryInterfaceFactory $productRepositoryFactory
)
$this->_productRepositoryFactory = $productRepositoryFactory;
In function
$_items = $order->getAllItems();
foreach($_items as $_item)
$id=$_item->getProductId();
$product = $this->_productRepositoryFactory->create()->getById($item->getProductId());
$product->getData('image');
$product->getData('thumbnail');
$product->getData('small_image');
$product->getCategoryIds();
1
Did you try this?
– MSA
Jul 2 at 6:31
I'll try that. how can we get images of the same product? getGallery??? and category also? getCategory?
– rakcode
Jul 3 at 10:32
Thanks. Can you please check my another question. no one replied to me on that one! :(
– rakcode
Jul 3 at 11:15
1
Did you check updated answer?
– MSA
Jul 3 at 11:16
Yes its working fine for me. Thanks.
– rakcode
Jul 3 at 12:56
add a comment |
You can get price,sku,description by following code
$_product_price = $product->getPrice();
$_product_image= $product->getImage();
$_product_sku = $product->getSku();
$_product_desc=$product->getDescription();
updated solution
get category ids and images by following code
protected $_productRepositoryFactory;
public function __construct(
MagentoCatalogApiProductRepositoryInterfaceFactory $productRepositoryFactory
)
$this->_productRepositoryFactory = $productRepositoryFactory;
In function
$_items = $order->getAllItems();
foreach($_items as $_item)
$id=$_item->getProductId();
$product = $this->_productRepositoryFactory->create()->getById($item->getProductId());
$product->getData('image');
$product->getData('thumbnail');
$product->getData('small_image');
$product->getCategoryIds();
1
Did you try this?
– MSA
Jul 2 at 6:31
I'll try that. how can we get images of the same product? getGallery??? and category also? getCategory?
– rakcode
Jul 3 at 10:32
Thanks. Can you please check my another question. no one replied to me on that one! :(
– rakcode
Jul 3 at 11:15
1
Did you check updated answer?
– MSA
Jul 3 at 11:16
Yes its working fine for me. Thanks.
– rakcode
Jul 3 at 12:56
add a comment |
You can get price,sku,description by following code
$_product_price = $product->getPrice();
$_product_image= $product->getImage();
$_product_sku = $product->getSku();
$_product_desc=$product->getDescription();
updated solution
get category ids and images by following code
protected $_productRepositoryFactory;
public function __construct(
MagentoCatalogApiProductRepositoryInterfaceFactory $productRepositoryFactory
)
$this->_productRepositoryFactory = $productRepositoryFactory;
In function
$_items = $order->getAllItems();
foreach($_items as $_item)
$id=$_item->getProductId();
$product = $this->_productRepositoryFactory->create()->getById($item->getProductId());
$product->getData('image');
$product->getData('thumbnail');
$product->getData('small_image');
$product->getCategoryIds();
You can get price,sku,description by following code
$_product_price = $product->getPrice();
$_product_image= $product->getImage();
$_product_sku = $product->getSku();
$_product_desc=$product->getDescription();
updated solution
get category ids and images by following code
protected $_productRepositoryFactory;
public function __construct(
MagentoCatalogApiProductRepositoryInterfaceFactory $productRepositoryFactory
)
$this->_productRepositoryFactory = $productRepositoryFactory;
In function
$_items = $order->getAllItems();
foreach($_items as $_item)
$id=$_item->getProductId();
$product = $this->_productRepositoryFactory->create()->getById($item->getProductId());
$product->getData('image');
$product->getData('thumbnail');
$product->getData('small_image');
$product->getCategoryIds();
edited Jul 3 at 11:00
answered Jul 1 at 9:31
MSAMSA
1,2663 silver badges17 bronze badges
1,2663 silver badges17 bronze badges
1
Did you try this?
– MSA
Jul 2 at 6:31
I'll try that. how can we get images of the same product? getGallery??? and category also? getCategory?
– rakcode
Jul 3 at 10:32
Thanks. Can you please check my another question. no one replied to me on that one! :(
– rakcode
Jul 3 at 11:15
1
Did you check updated answer?
– MSA
Jul 3 at 11:16
Yes its working fine for me. Thanks.
– rakcode
Jul 3 at 12:56
add a comment |
1
Did you try this?
– MSA
Jul 2 at 6:31
I'll try that. how can we get images of the same product? getGallery??? and category also? getCategory?
– rakcode
Jul 3 at 10:32
Thanks. Can you please check my another question. no one replied to me on that one! :(
– rakcode
Jul 3 at 11:15
1
Did you check updated answer?
– MSA
Jul 3 at 11:16
Yes its working fine for me. Thanks.
– rakcode
Jul 3 at 12:56
1
1
Did you try this?
– MSA
Jul 2 at 6:31
Did you try this?
– MSA
Jul 2 at 6:31
I'll try that. how can we get images of the same product? getGallery??? and category also? getCategory?
– rakcode
Jul 3 at 10:32
I'll try that. how can we get images of the same product? getGallery??? and category also? getCategory?
– rakcode
Jul 3 at 10:32
Thanks. Can you please check my another question. no one replied to me on that one! :(
– rakcode
Jul 3 at 11:15
Thanks. Can you please check my another question. no one replied to me on that one! :(
– rakcode
Jul 3 at 11:15
1
1
Did you check updated answer?
– MSA
Jul 3 at 11:16
Did you check updated answer?
– MSA
Jul 3 at 11:16
Yes its working fine for me. Thanks.
– rakcode
Jul 3 at 12:56
Yes its working fine for me. Thanks.
– rakcode
Jul 3 at 12:56
add a comment |
You current_product is the object of following class:
MagentoCatalogModelProduct
Path:
vendor/magento/module-catalog/Model/Product.php
Now you open this class and search your actual method.
add a comment |
You current_product is the object of following class:
MagentoCatalogModelProduct
Path:
vendor/magento/module-catalog/Model/Product.php
Now you open this class and search your actual method.
add a comment |
You current_product is the object of following class:
MagentoCatalogModelProduct
Path:
vendor/magento/module-catalog/Model/Product.php
Now you open this class and search your actual method.
You current_product is the object of following class:
MagentoCatalogModelProduct
Path:
vendor/magento/module-catalog/Model/Product.php
Now you open this class and search your actual method.
answered Jun 30 at 5:50
Sohel RanaSohel Rana
24.7k3 gold badges47 silver badges65 bronze badges
24.7k3 gold badges47 silver badges65 bronze badges
add a comment |
add a comment |
Following code will list you a functions list to get product data according to your code.
echo "<pre>";
var_dump(get_class_methods($product));
Hope it helps.
add a comment |
Following code will list you a functions list to get product data according to your code.
echo "<pre>";
var_dump(get_class_methods($product));
Hope it helps.
add a comment |
Following code will list you a functions list to get product data according to your code.
echo "<pre>";
var_dump(get_class_methods($product));
Hope it helps.
Following code will list you a functions list to get product data according to your code.
echo "<pre>";
var_dump(get_class_methods($product));
Hope it helps.
answered Jul 3 at 11:17
Mohit RaneMohit Rane
1276 bronze badges
1276 bronze badges
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%2f280190%2fwhat-are-other-possible-functions-i-can-access%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
1
You can take reference from this file for get product details
magento/vendor/magento/module-catalog/view/frontend/templates/product/list.phtml
– Pragnadeep Pitroda
Jun 29 at 17:17