-1

how to display the sku on the product category pages in grid view and list view.

Best way to display the SKU on the product category pages in grid view and list view.

I try to use service into view to get sku. but this is not proper way. I need to display sku using my plugin. i dont want to change code of nopcommerce.

Below snapshot provide information that where i need to display sku

enter image description here

sangeet
  • 121
  • 6

3 Answers3

0

You can see how it is already done for the next version in the official repository. See commit. Maybe it will give you ideas.

RomanovM
  • 180
  • 5
0

You can add SKU in _ProductBox.cshtml view easily by using widgets in your plugin. There are some widgets available in _ProductBox.cshtml view where you can inject the SKU through plugin, so you don`t have to change code of nopCommerce.

For example:

  • productbox_addinfo_before
  • productbox_addinfo_before
  • productbox_addinfo_after widget.

You can refer NivoSlider plugin in nopCommerce, which will help you to understand how to implement it.

In nivoslider plugin, home_page_top widget is used which will inject the banner on home page through nivo slider plugin. I hope this helps you.

manojkulkarni30
  • 304
  • 1
  • 2
  • 12
0

Very simple in Magento 2.

Follow this: In your theme...

app/design/frontend/Smartwave/porto/Magento_Catalog/templates/product/list.phtml

and go to line no 237 uper site the price. Paste the bellow code or you manage according your product name.

echo $_helper->productAttribute($_product, $_product->getSku(), 'SKU');

In my project display fine.

May it will help you.

סטנלי גרונן
  • 2,917
  • 23
  • 46
  • 68