How to get the Description of a MagentoCatalogModelProduct?How to get products description and short description in products list page?How to get the Description?Pull admin text value to display on Catalog/ Product/ ListMagento 2 - Keep Product Image Aspect RatioGet Price For Configurable Product Magento 2How to move the add to cart section under the short description on product view pageCan't override list.phtml in Magento 2.1.6How to get the price of all simple products assigned to configurable products in magento 2 listpage?Magento2 - How to get a custom attribute for catalog product?how to disable Add to compare option in list.phtml file magento 2 custom theme?Magento 2 - language override phtmlChange text and Relink the “Add To Cart” button in the product list page (list.phtml)

Do I need to leave some extra space available on the disk which my database log files reside, for log backup operations to successfully occur?

Too much vertical space above xrightarrow

What Happens when Passenger Refuses to Fly Boeing 737 Max?

Is it true that real estate prices mainly go up?

Do f-stop and exposure time perfectly cancel?

Force user to remove USB token

What is the dot in “1.2.4."

When two POV characters meet

Replacing Windows 7 security updates with anti-virus?

Potentiometer like component

This equation is outside the page, how to modify it

Can "semicircle" be used to refer to a part-circle that is not a exact half-circle?

Why do Australian milk farmers need to protest supermarkets' milk price?

Is all copper pipe pretty much the same?

What is the definition of "Natural Selection"?

validation vs test vs training accuracy, which one to compare for claiming overfit?

Running a subshell from the middle of the current command

How does Dispel Magic work against Stoneskin?

How does airport security verify that you can carry a battery bank over 100 Wh?

Provisioning profile doesn't include the application-identifier and keychain-access-groups entitlements

what does the apostrophe mean in this notation?

Who is our nearest neighbor

It's a yearly task, alright

Silly Sally's Movie



How to get the Description of a MagentoCatalogModelProduct?


How to get products description and short description in products list page?How to get the Description?Pull admin text value to display on Catalog/ Product/ ListMagento 2 - Keep Product Image Aspect RatioGet Price For Configurable Product Magento 2How to move the add to cart section under the short description on product view pageCan't override list.phtml in Magento 2.1.6How to get the price of all simple products assigned to configurable products in magento 2 listpage?Magento2 - How to get a custom attribute for catalog product?how to disable Add to compare option in list.phtml file magento 2 custom theme?Magento 2 - language override phtmlChange text and Relink the “Add To Cart” button in the product list page (list.phtml)













6















I'm in Magento2 and the getDescription(); does not work.



I'm in the file Magento_Catalog/templates/product/list.phtml if that's relevant.










share|improve this question




























    6















    I'm in Magento2 and the getDescription(); does not work.



    I'm in the file Magento_Catalog/templates/product/list.phtml if that's relevant.










    share|improve this question


























      6












      6








      6


      1






      I'm in Magento2 and the getDescription(); does not work.



      I'm in the file Magento_Catalog/templates/product/list.phtml if that's relevant.










      share|improve this question
















      I'm in Magento2 and the getDescription(); does not work.



      I'm in the file Magento_Catalog/templates/product/list.phtml if that's relevant.







      magento2 product-attribute phtml






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 3 hours ago









      Rafael Corrêa Gomes

      4,56923265




      4,56923265










      asked Apr 5 '16 at 17:32









      Philipp SanderPhilipp Sander

      6011521




      6011521




















          4 Answers
          4






          active

          oldest

          votes


















          10














          In Store > Attributes > Product > Description > Storefront Properties set Visible on Catalog Pages on Storefront and Used in Product Listing to TRUE.



          In your code list.phtml you can use:



          <?php echo $this->helper('MagentoCatalogHelperOutput')->productAttribute($_product, $_product->getDescription(), 'description') ?>


          or



          <?php echo $_product->getDescription() ?>





          share|improve this answer
































            1














            I solved it myself:



            I wrote a Helper that reloads the product, because it seems like the collection in the template I used, didn't load the full object.



            use MagentoCatalogModelProduct as ModelProduct;

            class Description extends MagentoFrameworkAppHelperAbstractHelper
            /**
            * @var MagentoCatalogModelProductFactory
            */
            protected $productFactory;

            /**
            * @param MagentoCatalogModelProductFactory $productFactory
            */
            public function __construct(
            MagentoCatalogModelProductFactory $productFactory
            )
            $this->productFactory = $productFactory;


            /**
            *
            * Load the product and return its description
            *
            * @param ModelProduct $product
            */
            public function getProductDescription($product)

            $reloadedProduct = $this->productFactory->create()->load($product->getId());

            return $reloadedProduct->getData('description');







            share|improve this answer























            • Ever thought about what could actually cause this?

              – Max
              Oct 26 '17 at 18:15


















            0














            See /vendor/magento/module-catalog/view/frontend/templates/product/view/description.phtml



            /**
            * Product description template
            *
            * @var $block MagentoCatalogBlockProductViewDescription
            */
            ?>
            <?php /* @escapeNotVerified */ echo $this->helper('MagentoCatalogHelperOutput')->productAttribute($block->getProduct(), $block->getProduct()->getDescription(), 'description') ?>





            share|improve this answer























            • I already tried that. It's not working. If you have a look at the class of the object that returned by getProduct you will see, that there's no getDescription()

              – Philipp Sander
              Apr 6 '16 at 8:22











            • github.com/magento/magento2/blob/develop/app/code/Magento/…

              – Philipp Sander
              Apr 6 '16 at 8:23











            • getDescription should be a magic method, where the string after "get" is the attribute name

              – ahnbizcad
              Sep 12 '16 at 4:26











            • Doesn't care if its not in the object, thus not a magic getter. :)

              – Max
              Oct 26 '17 at 18:15


















            0














            Try this:



            $productCollection = $this->helper('MagentoCatalogModelProductFactory');



            $product = $productCollection->create()->load($id);



            $description = $product->getDescription();






            share|improve this answer























            • Hi and welcome to stackoverflow! you're answer does exactly what mine does.

              – Philipp Sander
              Nov 12 '18 at 9:28










            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%2f109588%2fhow-to-get-the-description-of-a-magento-catalog-model-product%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            4 Answers
            4






            active

            oldest

            votes








            4 Answers
            4






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            10














            In Store > Attributes > Product > Description > Storefront Properties set Visible on Catalog Pages on Storefront and Used in Product Listing to TRUE.



            In your code list.phtml you can use:



            <?php echo $this->helper('MagentoCatalogHelperOutput')->productAttribute($_product, $_product->getDescription(), 'description') ?>


            or



            <?php echo $_product->getDescription() ?>





            share|improve this answer





























              10














              In Store > Attributes > Product > Description > Storefront Properties set Visible on Catalog Pages on Storefront and Used in Product Listing to TRUE.



              In your code list.phtml you can use:



              <?php echo $this->helper('MagentoCatalogHelperOutput')->productAttribute($_product, $_product->getDescription(), 'description') ?>


              or



              <?php echo $_product->getDescription() ?>





              share|improve this answer



























                10












                10








                10







                In Store > Attributes > Product > Description > Storefront Properties set Visible on Catalog Pages on Storefront and Used in Product Listing to TRUE.



                In your code list.phtml you can use:



                <?php echo $this->helper('MagentoCatalogHelperOutput')->productAttribute($_product, $_product->getDescription(), 'description') ?>


                or



                <?php echo $_product->getDescription() ?>





                share|improve this answer















                In Store > Attributes > Product > Description > Storefront Properties set Visible on Catalog Pages on Storefront and Used in Product Listing to TRUE.



                In your code list.phtml you can use:



                <?php echo $this->helper('MagentoCatalogHelperOutput')->productAttribute($_product, $_product->getDescription(), 'description') ?>


                or



                <?php echo $_product->getDescription() ?>






                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Jun 2 '16 at 19:02

























                answered Jun 2 '16 at 18:37









                Rafael Corrêa GomesRafael Corrêa Gomes

                4,56923265




                4,56923265























                    1














                    I solved it myself:



                    I wrote a Helper that reloads the product, because it seems like the collection in the template I used, didn't load the full object.



                    use MagentoCatalogModelProduct as ModelProduct;

                    class Description extends MagentoFrameworkAppHelperAbstractHelper
                    /**
                    * @var MagentoCatalogModelProductFactory
                    */
                    protected $productFactory;

                    /**
                    * @param MagentoCatalogModelProductFactory $productFactory
                    */
                    public function __construct(
                    MagentoCatalogModelProductFactory $productFactory
                    )
                    $this->productFactory = $productFactory;


                    /**
                    *
                    * Load the product and return its description
                    *
                    * @param ModelProduct $product
                    */
                    public function getProductDescription($product)

                    $reloadedProduct = $this->productFactory->create()->load($product->getId());

                    return $reloadedProduct->getData('description');







                    share|improve this answer























                    • Ever thought about what could actually cause this?

                      – Max
                      Oct 26 '17 at 18:15















                    1














                    I solved it myself:



                    I wrote a Helper that reloads the product, because it seems like the collection in the template I used, didn't load the full object.



                    use MagentoCatalogModelProduct as ModelProduct;

                    class Description extends MagentoFrameworkAppHelperAbstractHelper
                    /**
                    * @var MagentoCatalogModelProductFactory
                    */
                    protected $productFactory;

                    /**
                    * @param MagentoCatalogModelProductFactory $productFactory
                    */
                    public function __construct(
                    MagentoCatalogModelProductFactory $productFactory
                    )
                    $this->productFactory = $productFactory;


                    /**
                    *
                    * Load the product and return its description
                    *
                    * @param ModelProduct $product
                    */
                    public function getProductDescription($product)

                    $reloadedProduct = $this->productFactory->create()->load($product->getId());

                    return $reloadedProduct->getData('description');







                    share|improve this answer























                    • Ever thought about what could actually cause this?

                      – Max
                      Oct 26 '17 at 18:15













                    1












                    1








                    1







                    I solved it myself:



                    I wrote a Helper that reloads the product, because it seems like the collection in the template I used, didn't load the full object.



                    use MagentoCatalogModelProduct as ModelProduct;

                    class Description extends MagentoFrameworkAppHelperAbstractHelper
                    /**
                    * @var MagentoCatalogModelProductFactory
                    */
                    protected $productFactory;

                    /**
                    * @param MagentoCatalogModelProductFactory $productFactory
                    */
                    public function __construct(
                    MagentoCatalogModelProductFactory $productFactory
                    )
                    $this->productFactory = $productFactory;


                    /**
                    *
                    * Load the product and return its description
                    *
                    * @param ModelProduct $product
                    */
                    public function getProductDescription($product)

                    $reloadedProduct = $this->productFactory->create()->load($product->getId());

                    return $reloadedProduct->getData('description');







                    share|improve this answer













                    I solved it myself:



                    I wrote a Helper that reloads the product, because it seems like the collection in the template I used, didn't load the full object.



                    use MagentoCatalogModelProduct as ModelProduct;

                    class Description extends MagentoFrameworkAppHelperAbstractHelper
                    /**
                    * @var MagentoCatalogModelProductFactory
                    */
                    protected $productFactory;

                    /**
                    * @param MagentoCatalogModelProductFactory $productFactory
                    */
                    public function __construct(
                    MagentoCatalogModelProductFactory $productFactory
                    )
                    $this->productFactory = $productFactory;


                    /**
                    *
                    * Load the product and return its description
                    *
                    * @param ModelProduct $product
                    */
                    public function getProductDescription($product)

                    $reloadedProduct = $this->productFactory->create()->load($product->getId());

                    return $reloadedProduct->getData('description');








                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Apr 6 '16 at 11:46









                    Philipp SanderPhilipp Sander

                    6011521




                    6011521












                    • Ever thought about what could actually cause this?

                      – Max
                      Oct 26 '17 at 18:15

















                    • Ever thought about what could actually cause this?

                      – Max
                      Oct 26 '17 at 18:15
















                    Ever thought about what could actually cause this?

                    – Max
                    Oct 26 '17 at 18:15





                    Ever thought about what could actually cause this?

                    – Max
                    Oct 26 '17 at 18:15











                    0














                    See /vendor/magento/module-catalog/view/frontend/templates/product/view/description.phtml



                    /**
                    * Product description template
                    *
                    * @var $block MagentoCatalogBlockProductViewDescription
                    */
                    ?>
                    <?php /* @escapeNotVerified */ echo $this->helper('MagentoCatalogHelperOutput')->productAttribute($block->getProduct(), $block->getProduct()->getDescription(), 'description') ?>





                    share|improve this answer























                    • I already tried that. It's not working. If you have a look at the class of the object that returned by getProduct you will see, that there's no getDescription()

                      – Philipp Sander
                      Apr 6 '16 at 8:22











                    • github.com/magento/magento2/blob/develop/app/code/Magento/…

                      – Philipp Sander
                      Apr 6 '16 at 8:23











                    • getDescription should be a magic method, where the string after "get" is the attribute name

                      – ahnbizcad
                      Sep 12 '16 at 4:26











                    • Doesn't care if its not in the object, thus not a magic getter. :)

                      – Max
                      Oct 26 '17 at 18:15















                    0














                    See /vendor/magento/module-catalog/view/frontend/templates/product/view/description.phtml



                    /**
                    * Product description template
                    *
                    * @var $block MagentoCatalogBlockProductViewDescription
                    */
                    ?>
                    <?php /* @escapeNotVerified */ echo $this->helper('MagentoCatalogHelperOutput')->productAttribute($block->getProduct(), $block->getProduct()->getDescription(), 'description') ?>





                    share|improve this answer























                    • I already tried that. It's not working. If you have a look at the class of the object that returned by getProduct you will see, that there's no getDescription()

                      – Philipp Sander
                      Apr 6 '16 at 8:22











                    • github.com/magento/magento2/blob/develop/app/code/Magento/…

                      – Philipp Sander
                      Apr 6 '16 at 8:23











                    • getDescription should be a magic method, where the string after "get" is the attribute name

                      – ahnbizcad
                      Sep 12 '16 at 4:26











                    • Doesn't care if its not in the object, thus not a magic getter. :)

                      – Max
                      Oct 26 '17 at 18:15













                    0












                    0








                    0







                    See /vendor/magento/module-catalog/view/frontend/templates/product/view/description.phtml



                    /**
                    * Product description template
                    *
                    * @var $block MagentoCatalogBlockProductViewDescription
                    */
                    ?>
                    <?php /* @escapeNotVerified */ echo $this->helper('MagentoCatalogHelperOutput')->productAttribute($block->getProduct(), $block->getProduct()->getDescription(), 'description') ?>





                    share|improve this answer













                    See /vendor/magento/module-catalog/view/frontend/templates/product/view/description.phtml



                    /**
                    * Product description template
                    *
                    * @var $block MagentoCatalogBlockProductViewDescription
                    */
                    ?>
                    <?php /* @escapeNotVerified */ echo $this->helper('MagentoCatalogHelperOutput')->productAttribute($block->getProduct(), $block->getProduct()->getDescription(), 'description') ?>






                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Apr 5 '16 at 17:44









                    Joshua34Joshua34

                    1,5691020




                    1,5691020












                    • I already tried that. It's not working. If you have a look at the class of the object that returned by getProduct you will see, that there's no getDescription()

                      – Philipp Sander
                      Apr 6 '16 at 8:22











                    • github.com/magento/magento2/blob/develop/app/code/Magento/…

                      – Philipp Sander
                      Apr 6 '16 at 8:23











                    • getDescription should be a magic method, where the string after "get" is the attribute name

                      – ahnbizcad
                      Sep 12 '16 at 4:26











                    • Doesn't care if its not in the object, thus not a magic getter. :)

                      – Max
                      Oct 26 '17 at 18:15

















                    • I already tried that. It's not working. If you have a look at the class of the object that returned by getProduct you will see, that there's no getDescription()

                      – Philipp Sander
                      Apr 6 '16 at 8:22











                    • github.com/magento/magento2/blob/develop/app/code/Magento/…

                      – Philipp Sander
                      Apr 6 '16 at 8:23











                    • getDescription should be a magic method, where the string after "get" is the attribute name

                      – ahnbizcad
                      Sep 12 '16 at 4:26











                    • Doesn't care if its not in the object, thus not a magic getter. :)

                      – Max
                      Oct 26 '17 at 18:15
















                    I already tried that. It's not working. If you have a look at the class of the object that returned by getProduct you will see, that there's no getDescription()

                    – Philipp Sander
                    Apr 6 '16 at 8:22





                    I already tried that. It's not working. If you have a look at the class of the object that returned by getProduct you will see, that there's no getDescription()

                    – Philipp Sander
                    Apr 6 '16 at 8:22













                    github.com/magento/magento2/blob/develop/app/code/Magento/…

                    – Philipp Sander
                    Apr 6 '16 at 8:23





                    github.com/magento/magento2/blob/develop/app/code/Magento/…

                    – Philipp Sander
                    Apr 6 '16 at 8:23













                    getDescription should be a magic method, where the string after "get" is the attribute name

                    – ahnbizcad
                    Sep 12 '16 at 4:26





                    getDescription should be a magic method, where the string after "get" is the attribute name

                    – ahnbizcad
                    Sep 12 '16 at 4:26













                    Doesn't care if its not in the object, thus not a magic getter. :)

                    – Max
                    Oct 26 '17 at 18:15





                    Doesn't care if its not in the object, thus not a magic getter. :)

                    – Max
                    Oct 26 '17 at 18:15











                    0














                    Try this:



                    $productCollection = $this->helper('MagentoCatalogModelProductFactory');



                    $product = $productCollection->create()->load($id);



                    $description = $product->getDescription();






                    share|improve this answer























                    • Hi and welcome to stackoverflow! you're answer does exactly what mine does.

                      – Philipp Sander
                      Nov 12 '18 at 9:28















                    0














                    Try this:



                    $productCollection = $this->helper('MagentoCatalogModelProductFactory');



                    $product = $productCollection->create()->load($id);



                    $description = $product->getDescription();






                    share|improve this answer























                    • Hi and welcome to stackoverflow! you're answer does exactly what mine does.

                      – Philipp Sander
                      Nov 12 '18 at 9:28













                    0












                    0








                    0







                    Try this:



                    $productCollection = $this->helper('MagentoCatalogModelProductFactory');



                    $product = $productCollection->create()->load($id);



                    $description = $product->getDescription();






                    share|improve this answer













                    Try this:



                    $productCollection = $this->helper('MagentoCatalogModelProductFactory');



                    $product = $productCollection->create()->load($id);



                    $description = $product->getDescription();







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Nov 11 '18 at 13:50









                    Hieu Pham MinhHieu Pham Minh

                    12




                    12












                    • Hi and welcome to stackoverflow! you're answer does exactly what mine does.

                      – Philipp Sander
                      Nov 12 '18 at 9:28

















                    • Hi and welcome to stackoverflow! you're answer does exactly what mine does.

                      – Philipp Sander
                      Nov 12 '18 at 9:28
















                    Hi and welcome to stackoverflow! you're answer does exactly what mine does.

                    – Philipp Sander
                    Nov 12 '18 at 9:28





                    Hi and welcome to stackoverflow! you're answer does exactly what mine does.

                    – Philipp Sander
                    Nov 12 '18 at 9:28

















                    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%2f109588%2fhow-to-get-the-description-of-a-magento-catalog-model-product%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

                    Best approach to update all entries in a list that is paginated?Best way to add items to a paginated listChoose Your Country: Best Usability approachUpdate list when a user is viewing the list without annoying themWhen would the best day to update your webpage be?What should happen when I add a Row to a paginated, sorted listShould I adopt infinite scrolling or classical pagination?How to show user that page objects automatically updateWhat is the best location to locate the comments section in a list pageBest way to combine filtering and selecting items in a listWhen one of two inputs must be updated to satisfy a consistency criteria, which should you update (if at all)?

                    Вунгтау (аеропорт) Загальні відомості | Див. також | Посилання | Навігаційне меню10°22′00″ пн. ш. 107°05′00″ сх. д. / 10.36667° пн. ш. 107.08333° сх. д. / 10.36667; 107.0833310°22′00″ пн. ш. 107°05′00″ сх. д. / 10.36667° пн. ш. 107.08333° сх. д. / 10.36667; 107.083337731608Vinh AirportVinh airport facelift improves serviceвиправивши або дописавши їївиправивши або дописавши їїр

                    Тонконіг бульбистий Зміст Опис | Поширення | Екологія | Господарське значення | Примітки | Див. також | Література | Джерела | Посилання | Навігаційне меню1114601320038-241116202404kew-435458Poa bulbosaЭлектронный каталог сосудистых растений Азиатской России [Електронний каталог судинних рослин Азіатської Росії]Малышев Л. Л. Дикие родичи культурных растений. Poa bulbosa L. - Мятлик луковичный. [Малишев Л. Л. Дикі родичи культурних рослин. Poa bulbosa L. - Тонконіг бульбистий.]Мятлик (POA) Сем. Злаки (Мятликовые) [Тонконіг (POA) Род. Злаки (Тонконогові)]Poa bulbosa Linnaeus, Sp. Pl. 1: 70. 1753. 鳞茎早熟禾 lin jing zao shu he (Description from Flora of China) [Poa bulbosa Linnaeus, Sp. Pl. 1: 70. 1753. 鳞茎早熟禾 lin jing zao shu he (Опис від Флора Китаю)]Poa bulbosa L. – lipnice cibulkatá / lipnica cibulkatáPoa bulbosa в базі даних Poa bulbosa на сайті Poa bulbosa в базі даних «Global Biodiversity Information Facility» (GBIF)Poa bulbosa в базі даних «Euro + Med PlantBase» — інформаційному ресурсі для Євро-середземноморського розмаїття рослинPoa bulbosa L. на сайті «Плантариум»