cancel
Showing results for 
Search instead for 
Did you mean: 

Inset Short Description into Grid, or output Attributes into Grid.

Highlighted

Inset Short Description into Grid, or output Attributes into Grid.

Hi there, Just starting out with MG2 2.3.3. Just seeing how superior it is to WooCommerce. Please forgive my ignorance.

 

Im trying to build a PC/Laptop store, and Im using the Porto Theme.

I currently a "quick spec" of my products, this is set as the Short Description (they are also attirbutes).

 

I have my default layout for products set to grid, and want to either output selected Attributes in a UL list, or simply output the short description.

 

I have attached, the UL that is currently set in description, and then a quick Photoshopped mockup of what I would like?

 

can anyone help, or point me the right direction?

 

Achieve.jpgProd_grid.PNGShort_Desc.PNG

 

8 REPLIES 8
Highlighted

Re: Inset Short Description into Grid, or output Attributes into Grid.

@robert_eccles you can do this.

 

But for this there is no default functionality.

You have to do the customisation for this.

 

You have to create a new catalog_product_view.xml file and in that you can create your own custom layout.

 

Please let me know if you stuck anywhere.

 

Thanks

Highlighted

Re: Inset Short Description into Grid, or output Attributes into Grid.

Hi there,

 

I think Porto have created their own custom layout for this. But I cant seem to see where to add the code.

 

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2018 Porto. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page layout="2columns-right" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="sidebar.additional">
            <block class="Smartwave\Porto\Block\Template" name="product_view_custom_block" before="-" template="Magento_Catalog::product/view/custom_block.phtml"/>
        </referenceContainer>
        <move element="product.info.stock.sku" destination="product.info.price" after="product.price.final"/>
        <move element="product.info.review" destination="product.info.main" before="product.info.price"/>
        <move element="catalog.product.related" destination="sidebar.additional" after="product_view_custom_block"/>
        <!--<referenceBlock name="catalog.product.related" remove="true"/>-->
        <move element="product.info.overview" destination="product.info.main" after="product.info.review"/>
        <referenceContainer name="after.body.start">
            <block class="Magento\Catalog\Block\Product\View" name="product_custom" template="Magento_Catalog::product/view/product_custom.phtml" before="-"/>
            <block class="Smartwave\Porto\Block\Template" name="product_view_config" after="-" template="Magento_Catalog::product/view/config.phtml"/>
        </referenceContainer>
        <referenceContainer name="columns.top">
            <block class="Magento\Catalog\Block\Product\View" name="prev_next_products" template="Magento_Catalog::product/view/prev_next.phtml" before="-"/>
        </referenceContainer>
        <move element="prev_next_products" destination="product.info.main" before="-"/>
        <move element="page.main.title" destination="product.info.main" before="-"/>
        <referenceContainer name="product.info.social">
            <block class="Smartwave\Porto\Block\Template" name="product_view_addthis_links" after="-" template="Magento_Catalog::product/view/addthis.phtml"/>
        </referenceContainer>
        <referenceContainer name="content">
            <block class="Smartwave\Porto\Block\RickSnippet" name="rich_snippet" template="Magento_Catalog::product/view/rich_snippet.phtml" before="-"/>
            <block class="Smartwave\Porto\Block\Template" name="product_view_main_custom_block" ifconfig="porto_settings/product/main_custom_block" before="product.info.main" template="Magento_Catalog::product/view/main_custom_block.phtml"/>
            <block class="Smartwave\Porto\Block\Template" name="product_view_main_custom_block2" after="-" template="Magento_Catalog::product/view/main_custom_block2.phtml"/>
            <block class="Smartwave\Porto\Block\Template" name="product.clearer" after="product.info.media" template="Magento_Catalog::product/view/clearer.phtml"/>
        </referenceContainer>
        <move element="product_view_main_custom_block2" destination="product.info.main" after="product.info.overview"/>
        <move element="product.info.main" destination="content" after="product.info.media"/>
        <referenceContainer name="columns">
            <block class="Smartwave\Porto\Block\Template" name="side_popup" after="-" template="Magento_Catalog::product/view/side_popup.phtml"/>
        </referenceContainer>
    </body>
</page>

 

 

 

Rob.

Highlighted

Re: Inset Short Description into Grid, or output Attributes into Grid.

@robert_eccles not here you can add that in template file.

Highlighted

Re: Inset Short Description into Grid, or output Attributes into Grid.

Sorry, I dont quite understand what you mean?

 

Enabling "Used in Product Listing" on the short description only enables it within "list view".

 

I can see that file is called "grid.phtml". I have tried adding this to that file, just under the "product title" div. But it isn't doing anything.

 

Sorry for sounding like I dont know what I am doing. Thats becuase I dont Smiley Sad

 

<strong class="product name product-item-name">
                            <a class="product-item-link"
                               href="<?php echo $_product->getProductUrl() ?>">
                                <?php echo $_helper->productAttribute($_product, $_product->getName(), 'name'); ?>
                            </a>
                        </strong>
<?php if ($showDescription):?>
                            <div class="product description product-item-description">
                                <?php echo $_helper->productAttribute($_product, $_product->getShortDescription(), 'short_description') ?>
                            </div>
                        <?php endif; ?>
Highlighted

Re: Inset Short Description into Grid, or output Attributes into Grid.

@robert_eccles you need this on product detail page?

 

I have shared you one link.

Refer that link and enable the template path hints.

Then go to the product detail page and there you can find which phtml file is responsible for showing data there.

 

Just check that file and add the code there.

 

Thanks

Highlighted

Re: Inset Short Description into Grid, or output Attributes into Grid.

Hi Rahul

 

Cant find the link you shared?

 

Also, I have already enabled template path hints. Thats how I knew the name of the file was grid.phtml.

 

Not on the product detail page no. It already appears there. Its on the home page, and also on the catalog pages.

 

http://dev.tetrade.co.uk

 

If you go there, you will see. On the homepage, all the products, featured and sales items. But also on the category pages, or here http://dev.tetrade.co.uk/computing/desktop-pcs/refurbished-desktop-pcs

 

You can see, if you change to list view - the short description appears. But not on the "grid view".

 

I really appreciated your help by the way.

Rob.

Highlighted

Re: Inset Short Description into Grid, or output Attributes into Grid.

hello, @rahul Gupta am Shaziya please help me,

I want to display a short description on the product listing page how can!

you can also text me in social: shaziyali8 (Instagram)

Highlighted

Re: Inset Short Description into Grid, or output Attributes into Grid.

Try to continue with this one

<div class="container">
  <div class="row">
    <div class="col-sm">
      One of three columns
    </div>
    <div class="col-sm">
      One of three columns
    </div>
    <div class="col-sm">
      One of three columns
    </div>
  </div>
</div>