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;








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










share|improve this question

















  • 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

















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










share|improve this question

















  • 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













0












0








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










share|improve this question














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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jun 29 at 15:29









rakcoderakcode

1034 bronze badges




1034 bronze badges







  • 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












  • 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







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










3 Answers
3






active

oldest

votes


















1














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();





share|improve this answer




















  • 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


















2














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.






share|improve this answer






























    1














    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.






    share|improve this answer

























      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
      );



      );













      draft saved

      draft discarded


















      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









      1














      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();





      share|improve this answer




















      • 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














      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();





      share|improve this answer




















      • 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








      1







      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();





      share|improve this answer















      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();






      share|improve this answer














      share|improve this answer



      share|improve this answer








      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












      • 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













      2














      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.






      share|improve this answer



























        2














        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.






        share|improve this answer

























          2












          2








          2







          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.






          share|improve this answer













          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.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          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





















              1














              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.






              share|improve this answer



























                1














                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.






                share|improve this answer

























                  1












                  1








                  1







                  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.






                  share|improve this answer













                  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.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jul 3 at 11:17









                  Mohit RaneMohit Rane

                  1276 bronze badges




                  1276 bronze badges



























                      draft saved

                      draft discarded
















































                      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.




                      draft saved


                      draft discarded














                      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





















































                      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







                      Popular posts from this blog

                      Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

                      Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

                      Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?