-2

I am trying to add the product default weight under the price in category page on OpenCart3, how I can do that?

J.Fredy
  • 49
  • 1
  • 5

2 Answers2

1

I have good answer for the show Product weight under price in Category page here

In the category section you can following steps:

step : 1 first fall you are open file : catalog/controller/product/category.php

find below line

'minimum'     => $result['minimum'] > 0 ? $result['minimum'] : 1,

after add or write following code

'weight'      => $result['weight'],

step : 2 open file : catalog/view/theme/default/template/product/category.twig

find below line

{% if product.rating %}

before add or write following code

<span class="text-weight" style="font-size: 12px;font-weight: 600;color: #e82a17;">weight : {{product.weight}} </span>

I hope my code is 100% working.if any issue you can ask to me via comment box.

Thanks You.

Mujahid Bhoraniya
  • 1,518
  • 10
  • 22
0

I have done a similar answer for the weight under price in product page here

For the category page it is very much the same:

  1. in file catalog/controller/product/category.php on line 203 add
'weight'      => $result['weight'] + 0,
  1. in file catalog/view/theme/default/template/product/category.twig on line 142 add
{{product.weight}}

this will show the weight as such

enter image description here

Dmitriy Zhuk
  • 757
  • 1
  • 6
  • 9