【问题标题】:How to extracting individual dimensions from $node->content['dimensions'] in Drupal's Ubercart?如何从 Drupal 的 Ubercart 中的 $node->content['dimensions'] 中提取单个维度?
【发布时间】:2011-03-02 08:50:10
【问题描述】:

在我的 Ubercart node-product.tpl.php 页面上,我试图从更通用的print $node->content['dimensions'] ['#value']; 中提取单个产品尺寸(高度、重量、长度),它返回“尺寸:72 英寸 × 42 英寸 × 30 英寸。”

使用var_dump(get_defined_vars()); 我可以看到尺寸正在独立输出,但似乎无法打印出来。在页面上。单独调用维度的正确方法是什么?

【问题讨论】:

    标签: php drupal ubercart


    【解决方案1】:

    你能转储 $node 对象吗?它们可能在内容数组之外。然后你可以打印 $node->product->length,或者任何属性。

    【讨论】:

      猜你喜欢
      • 2012-03-06
      • 2023-03-06
      • 1970-01-01
      • 1970-01-01
      • 2017-08-29
      • 1970-01-01
      • 2011-01-20
      • 2017-01-05
      • 2011-09-21
      相关资源
      最近更新 更多