我想在OpenCart3的类别页面中添加产品默认重量,我该怎么做?
谢谢
我为weight under price in product page here做了类似的答案
对于类别页面,它非常相似:
catalog/controller/product/category.php
上line 203
添加'weight' => $result['weight'] + 0,
catalog/view/theme/default/template/product/category.twig
上line 142
添加{{product.weight}}
这将显示重量
我在这里的分类页面中显示产品重量下的产品重量有很好的答案
在类别部分中,您可以执行以下步骤:
步骤:1首先你打开文件:catalog / controller / product / category.php
找到下面的行
'minimum' => $result['minimum'] > 0 ? $result['minimum'] : 1,
添加或写入以下代码后
'weight' => $result['weight'],
步骤:2打开文件:catalog / view / theme / default / template / product / category.twig
找到下面的行
{% if product.rating %}
在添加或编写以下代码之前
<span class="text-weight" style="font-size: 12px;font-weight: 600;color: #e82a17;">weight : {{product.weight}} </span>
我希望我的代码100%正常工作。如有任何问题,您可以通过评论框向我询问。
谢谢。