虚位以待(AD)
虚位以待(AD)
首页 > CMS教程 > Ecshop > ecshop随意调用自定义属性

ecshop随意调用自定义属性
类别:Ecshop   作者:码皇   来源:互联网   点击:

在网店程序ecshop中随意调用自定义属性方法。 goods php 找到 $properties = get_goods_properties($goods_id); 获得商品的规格和属性 我的229行 增加以下代码 自定义属性数据结构 ,魔客吧
在网店程序ecshop中随意调用自定义属性方法。

goods.php
找到
$properties = get_goods_properties($goods_id); // 获得商品的规格和属性
我的229行

增加以下代码

//自定义属性数据结构

 if($properties['pro']){            $myprolist = $properties['pro']['Attribute'];            $mypro = array();            foreach ($myprolist as $key => $v) {                $name = $v['name'];                $mypro[$name] = $v['value'];            }        } 	$smarty->assign('mypro',          $mypro);                              // 商品属性

/*
array(2) {
["Shape"]=>
string(5) “Round”
["Length"]=>
string(4) “52mm”
}
*/

在goods.dwt模板里,就可以在任意的地方调用自己想调用的属性了。

   {$mypro.Length}

最后的最后,你就能随意设计自己的属性界面了。比如

相关热词搜索: ecshop随意调用自定义属性