在类别页面的价格下添加产品重量
Add product weight under price in category page
我想在 OpenCart3 的类别页面的价格下添加产品默认重量,我该怎么做?
我已经为
做了类似的回答
对于类别页面,它非常相似:
- 在文件
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% working.if 您可以通过评论框向我提出任何问题。
谢谢。
我想在 OpenCart3 的类别页面的价格下添加产品默认重量,我该怎么做?
我已经为
对于类别页面,它非常相似:
- 在文件
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% working.if 您可以通过评论框向我提出任何问题。
谢谢。