【问题标题】:Getting virtuemart price at the template在模板上获取德德玛特价格
【发布时间】:2012-06-27 17:30:29
【问题描述】:

我是 joomla 的新手,我快疯了,因为我想仅使用产品的 ID 在模板中获取产品的价格(和其他元数据),有没有人能告诉我如何获得它,也许使用 helper o 静态方法实例化类? (我已经用谷歌搜索过了)。这是 Virtuemart 1.1.3 和 joomla 1.5.10。

提前致谢。

【问题讨论】:

  • 有关版本的一些信息,以及您尝试过的内容会非常有帮助。
  • 你说得对。我已经添加了这些数据。
  • 更好,但你所说的只是“我想要......”。没有说明你想要它在哪里,或者用它做什么——我的第一反应是“查看数据库,它就在那里”。再次,您尝试过的示例。我们不会在这里编写您的代码,我们会帮助您解决在执行此操作时遇到的问题。
  • 你说得对,对不起,我生气了。我刚刚纠正了这一点。

标签: joomla helper virtuemart


【解决方案1】:

仍然不清楚你想在哪里使用它,但如果你想从 VM 中获取产品信息,你可以查看很多地方,看看它是否适合你试图完成:

Virtuemart 自定义 Theme.php

components\com_virtuemart\themes\default\theme.php 找到。允许您编写自定义函数来访问 VM 中的任何内容以供您自己使用。

/**
* This is the theme's function file.
* It allows you to declare additional functions and classes
* that may be used in your templates
*

在 Flypage 上浏览结果

搜索/浏览保存了许多产品字段 - 它们被保存到接近 html\show.browse.php 末尾的数组中(查找 $products[$i]['product_price'] = $product_price;),然后使用 $tpl->set( 'products', $products ) 加载到 VM 模板中,最后在渲染产品飞页

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-12-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-02-06
    • 1970-01-01
    • 2014-02-22
    相关资源
    最近更新 更多