I have to display description on product list view page, But I want to display description to click quick view popup page.
plz, check image?
I have to display description on product list view page, But I want to display description to click quick view popup page.
plz, check image?
To get product description in the quickview pop-up do the following:
Create a new template file (new .phtml file) and place it in your theme directory Vendor/theme/Magento_Catalog/templates/product/view
In your template file, say quickview-descr.phtml place this code:
<?php
// @codingStandardsIgnoreFile
/**
* Product description template
*
* @var $block \Magento\Catalog\Block\Product\View\Description
* @var $block \Magento\Catalog\Block\Product\View\Attributes
*/
?>
<p class="just"><?= /* @escapeNotVerified */ $this->helper('Magento\Catalog\Helper\Output')->productAttribute($block->getProduct(), $block->getProduct()->getShortDescription(), 'short_description') ?></p>
*You can use
->getDescription(), 'description'
For the full product description.
The layout name will be similar to: quickview_product_view.xml
In the layout file, find
<container name="product.info.main"> or <container name="product.info.details">
and locate the position within the quick view page layout where you want to place the product description.
Say, you may want to place it under the product title container
<block class="Magento\Theme\Block\Html\Title" name="page.main.title" template="html/title.phtml"/>
Call your template file from the quick view layout at the desired location:
<block class="Magento\Catalog\Block\Product\View\Description" name="product.info.details" template="product/view/quickview-descr.phtml" after="page.main.title" />
Save. Clear cache
php bin/magento cache:flush