Php 在类别页面的价格下添加产品重量

Php 在类别页面的价格下添加产品重量,php,opencart,Php,Opencart,我正在尝试在OpenCart3的“类别中的价格”页面下添加产品默认权重,我如何做到这一点?我已经为 对于分类页面,它非常相似: 在第203行的文件catalog/controller/product/category.php中添加 'weight'=>$result['weight']+0, 在第142行的文件目录/view/theme/default/template/product/category.twig中添加 这将显示重量 对于在分类页面中显示价格下的产品重量,我有一个很好的答案 在

我正在尝试在OpenCart3的“类别中的价格”页面下添加产品默认权重,我如何做到这一点?

我已经为

对于分类页面,它非常相似:

  • 第203行的文件
    catalog/controller/product/category.php
    中添加
  • 'weight'=>$result['weight']+0,
    
  • 第142行的文件
    目录/view/theme/default/template/product/category.twig
    中添加
  • 这将显示重量


    对于在分类页面中显示价格下的产品重量,我有一个很好的答案

    在“类别”部分中,您可以执行以下步骤:

    步骤:1第一个秋天您打开了文件:catalog/controller/product/category.php

    下线

    'minimum'     => $result['minimum'] > 0 ? $result['minimum'] : 1,
    
    之后添加或编写以下代码

    'weight'      => $result['weight'],
    
    <span class="text-weight" style="font-size: 12px;font-weight: 600;color: #e82a17;">weight : {{product.weight}} </span>
    
    步骤:2打开文件:catalog/view/theme/default/template/product/category.twig

    下线

    {% if product.rating %}
    
    在添加或编写以下代码之前

    'weight'      => $result['weight'],
    
    <span class="text-weight" style="font-size: 12px;font-weight: 600;color: #e82a17;">weight : {{product.weight}} </span>
    
    weight:{{product.weight}
    
    我希望我的代码是100%的工作。如果有任何问题,你可以问我通过评论框

    谢谢你